published on 02.08.2020

Introduction

A few days ago, I decided to migrate my website from Jekyll to Hugo. Instead of using a theme from the Hugo community, I wanted to port my existing website. Converting, markdown content and SCSS wasn’t hard. I read a few articles, blogs, and the original documentation to learn about Hugo’s directory structure. Then simply copy-pasted files. The hardest part was the templates.

If you don’t have anything custom, and displaying blog posts is enough for you, migrating from Jekyll should take nothing but a few minutes. Yet, if you are going to make something custom, you have to learn about the Hugo templates. By custom, I mean listing the posts the way you wanted to list them, loop through them, group them by some property, and so on. The object here doesn’t have to be blog posts, it can be movies, actors, games, players, authors, books, genres, musicians; depending on the context of your site. You probably won’t need to play with Hugo templates if you are going to create a simple portfolio, project showcase, or blog site. Yet, I usually waste my time figuring out how things work. If you can call it a waste.

Why ?

Why I migrated from Jekyll? Jekyll probably is the most popular static site generator. In 2018, when I first decided to create a blog, I met Jekyll. Popularity is important here, it means a strong community. In consequence, popularity helps you find solutions to your problems quickly. Because someone else already faced the same problem and asked about it in the community. To be honest, I didn’t make good research about static site generators. I read that Jekyll is the most popular and well-documented one. Also that it’s fairly easy.

Before starting with Jekyll, I considered to learn Django. I knew some Python already then I figured, Django would be an overkill for a static site. Anyway, I chose Jekyll and went down the rabbit hole. Learned the templating language Jekyll using called Liquid and learned a bit of CSS.

With my weird and unnecessary templating fantasy Jekyll started to being slow. I made a quick search about other static site generators and found Hugo is faster and very popular like Jekyll. Yet, I wasn’t ready to learn another templating language. Note that Hugo is a little bit more complex than Jekyll.

Someday, I wanted to develop my blog on a different computer and I realized how cumbersome is to install the ruby environment and all that dependency hell Jekyll required, especially on windows. Hugo works with a single binary. Still, I can not re-build all that to just get rid of dependencies.

Recently, I took a machine learning class. We were using the R language in class. I chose to play cool with Rmarkdown files then I thought “what if I can host Rmarkdown files using Jekyll”. Turns out Blogdown does it and it supports Hugo mainly.

Besides all that, in times of covid-19 quarantine, I had enough time to learn Hugo. So, I migrated to Hugo.

You are reading the 1st of 19 episodes in Hugo.
Published on 02.08.2020 by Mert Bakır with commit 3be25fb.
hugo
#hugo #static-site
Next episode:
Understanding Hugo
published on 26.07.2020

This post contains nothing but notes that I took while experimenting Hugo templates. To understand each page and it’s variables (properties) I’ve created a partial called hugo_debug.html and used it in baseof.html, simply by adding this line: {{ partial "hugo_debug.html" . }} …

published on 03.08.2020

In this post, I aim to explain this website. Template by template… The main purpose here is to create a document to myself for future reference. Templates are complicated and not easy to read. That’s why I’ll probably forget what I did and why I coded this way. […] We are …

published on 21.08.2020

“Overwriting default landing page for Hugo taxonomies”. What do I mean by that? By default, Hugo will create a home page or a landing page for your taxonomies. /tags/ or /categories are good examples. If you don’t have any specific templates for tags /layouts/tags/list.html Hugo …

published on 10.07.2022

Previously, I’ve published a blog post about deploying static content on heroku with basic authentication. The main purpose was to get basic auth for a freely hosted static website. In that post, we hosted the source code on GitLab and configured a CI/CD pipeline to render the static content …

published on 28.05.2022

Each git commit has a field called Author which consists ‘user.name’ and ‘user.email’. We usually set these variables once, after installing git, with git config --global so that each repo gets the variables from the global definition. We can also set them locally for a …

published on 25.05.2022

In this post, I’ll first walk through hosting static content with basic authentication. Then, we’ll look into deploying to Heroku using GitLab Pipelines, more specifically deploying a certain sub-directory within the project instead of pushing the whole project. Also, I’ll share …

published on 17.04.2022
edited on 15.07.2022

Önceki bölümde, markdown formatını LaTeX formatına dönüştürmek için kullanılan Pandoc yazılımından bahsetmiştik. Şimdi konuyu bir adım daha ileri taşıyıp ve bookdown’a geçiyoruz. Bookdown; Rmarkdown kullanarak teknik dökümanlar, kitaplar yazabilmemizi sağlayan, Yihui Xie tarafından yazılmış …

published on 10.04.2022

I’ve been using WSL-2 on Windows for over a year. It’s very useful because some Python packages are just a headache to install on Windows. Also, docker. It’s just better on Linux. Yet, WSL-2 can also be problematic. I remember trying a dual-boot setup when things just went way too …

published on 03.03.2022

In this post, I’ll share how to install geopandas and some other gis related packages on Windows. If you are on Mac or Linux you can probably just pip install those without any issue. I usually had to do a google search every time I wanted to install these packages on Windows environment. Of …