Justin Duke

Hugo's internal templates, demystified

In my effort to throw a new coat of paint on this site, I was diving into Hugo’s internal templates to see how to improve their builtin pagination. It was invoked by calling _internal/pagination.html, so I assumed the template was something along the lines of pagination.html.

Turns out all the internal templates are hard-coded in the Hugo library itself, in a file named template_embedded.go. Rather than filing a snarky comment on the wisdom of this approach, I thought it might be helpful to list them out, as it’s definitely annoying to read in the source file.

Read more →

Deploying Hugo to S3 with s3cmd

This site (as well as my personal one) is built on Hugo and hosted on S3. I love this combination for a number of reasons: It’s incredibly fast to build. (This site, as I’m writing it, builds in 26 ms. Milliseconds. That’s insane.) It’s incredibly cheap. My S3 hosting costs are less than $5 a month. Deployment is easy. Each post is a flat .md file, and it takes two CLI commands to build and deploy the site.
Read more →

Setting up Twitter Cards in Hugo

Introduction to Hugo and Twitter Cards Okay, brief primer for those unaware (and, tbh, if you don’t know what Hugo is this post is probably not for you): Hugo is a super-fast static site generator (like Jekyll or Pelican) built in Go. It’s persnickety but powerful. I’m not going to go in depth into what Hugo is: here’s the main site if you want to learn more, but this post is targeted at folks who already have a basic Hugo site up and running that want to set up Twitter Cards for their Hugo site.
Read more →
© 2017 Justin Duke • All rights reserved • I hope you have a nice day.