Tuesday, January 12, 2021
5 Mins Hugo 04 - Getting Started
Tuesday, November 17, 2020
JAMstack JoymonOnline.in using Hugo - Part 03 - Current and proposed architecture & CI/CD system
The third part of the Hugo tutorial is also a theory. Here I am explaining the current architecture of my site https://joymononline.in and how it will look like in the proposed JAMstack based site using Hugo. Below is the video.
The main points discussed are- Current and proposed arch of JoymonOnline
- The problem with dynamic content in JAMstack.
- How to bring dynamic content into the site during compile-time and build the static site
- How to detect dynamic content changes and recompile the static site.
- How CI/CD work at the end using Zapier and GitHub Actions
Tuesday, November 10, 2020
[Video] Hugo date formatting bug - Oh it was a bad assumption
Mistakes are with humans. Most of those maybe because of ignorance, lack of experience, and there are many other reasons. But programmers make mistakes because of one more category called lack of reading documentation. They just try it and builds assumptions. When things are not getting working they think there is a bug. It could have occurred because of simple assumptions made without reading the documentation.
This is a story of such a mistake.
I got obsessed with Hugo especially with its templating. The templating is easy to learn and there are a lot of examples on the internet. If we take an example of date formatting, we can easily get help saying we can use "2006-Jan-2" as a format string to format the date. If we are from the traditional formatting world of "YYYY-MMM-DD" we feel this format is innovative and assumes that the year 2006 is just a year. Hugo is intelligent enough to understand any year in the format string.
With that ASSUMPTION if we give "2020-Jan-2' things will not work and start thinking as an error in Hugo. I went one more step ahead and did a video on the workaround saying use 2006 only. Below it is embedded.
Later publishing the video and when I get a chance I read the Hugo code as well as documentation. That opened my eyes. The documentation about the same is below.
https://gohugo.io/functions/format/#gos-layout-string
The above works for 'Date' data type only. To format string use the function .dateFormat .The root goes to the Go programming language that has this specific date to format dates.
Moral of the story is never goes with assumptions especially before deciding something is not working as expected.
Thursday, August 20, 2020
JAMstack JoymonOnline.in using Hugo - Part 01 Introduction
Introduction
Organization
Friday, July 31, 2020
Static Site Generator aka JAMstack for JoymonOnline.in personal portfolio web site
Fast and secure sites and apps delivered by pre-rendering files and serving them directly from a CDN, removing the requirement to manage or run web servers.
Pre-rendered sites can be enhanced with JavaScript and the growing capabilities of browsers and services available via APIs.You may have already seen or worked on a Jamstack site! They do not have to include all attributes of JavaScript, APIs, and Markup. They might be built using sites built by hand, or with Jekyll, Hugo, Nuxt, Next, Gatsby, or another static site generator...
Welcome to my experiments with JAM Stack.
The current state of JoymonOnline.in site
Problems
Keeping updatable contents
Client-side API calls
Testing efforts
Technology upgrade
The JAM Stack JoymonOnline.in
Plan
- No look and feel changes.
- All existing pages and adding one more page to show my YouTube videos.
- If possible no API calls from the client-side. Everything to be generated at the server. Includes GitHub projects, recent blog posts, etc...
