Jorge Aguilera

Open source Open mind

In this post I’ll show you how to create a static blog using JBake and deploy it at Netlify. Also I’ll show you how to vitaminate your blog with some server side functions using the functions feature of Netlify or the forms notification capability

JBake is a Java based open source static site/blog generator for developers …​ but you don’t need to know Java to use it.

Neflity is ".. everything you need to build fast, modern websites: continuous deployment, serverless functions, and so much more"

In this post I’ll show you how to build a static blog, hosting it at Netlify and how to enrich your blog with server-side functions

First step

You need to have a Netlify account and a Gitlab/Github account

Next you need to clone this repo (https://gitlab.com/jorge-aguilera/jbake-netlify) into a new Gitlab/Github repository (don’t forget to push it)

You need to link your repo with Netlify

netlify1

Once authorized, search your repo and select it

netlify2

Netlify will detect the default build command and you only need to click "deploy" ;)

netlify3

Netlify will deploy your site into their infraestructure and assign a name to it. You can change the name under the netlify.com domain or assign a domain if you’re the owner of it

netlify4

ServerSide (functions)

Netlify lets you deploy serverless Lambda functions without an AWS account, and with function management handled directly within Netlify. Your serverless functions are version-controlled, built, and deployed along with the rest of your Netlify site, and we will automatically handle service discovery through our built-in API gateway. This eliminates overhead and brings the power of Deploy Previews and rollbacks to your serverless functions

This repo come with some serverside functions as example

netlify5

Telegram

This function send a message when a user is reaching your blog with the url of the blog reached. To receive this message you need to have a Telegram Bot created and configure the following environment in Netlify to be able to receive the message

  • TELEGRAM_BOT_TOKEN the id of the bot

  • TELEGRAM_CHAT_ID the id of the chat where received the message

netlify6

Google Sheet

This function append a new row to a GoogleSheet every time a user hit a page of the blog. You need to create a service account credentials and configure the Netlify environment with this values:

  • GOOGLE_SHEET with the ID of the Sheet

  • GOOGLE_EMAIL the email of the service account

  • GOOGLE_PRIVATE_KEY the private key of the service account (you can locate it in the json file)

Also you need to configure the first row of the sheet with following text:

  • IP

  • URL

  • WHEN

This is an example:

google sheet

2014 - 2019 | Mixed with Foundation v5.5.1 | Baked with JBake v2.6.4