Hugo Post Formatting Basics

Markdown Your posts can be formatted using markdown syntax. It’s critical to know how it works. It’s super simple. Frontmatter You can add tags: [swift, json, network call] and it will then add the tags to your post. Add showToc: true and will show a table of contents for your post. Hugo automatically takes the first 70 words of your content as its summary and stores it into the .Summary variable The date of the field affects the order of the post. So if you drafted the markdown of your file 2yrs ago, but published it today, then make sure you adjust the date. Otherwise it will be buried under the newer posts. Instead, you can manually define where the summary ends with a “!–more–” (Notes: must be wrapped inside angle brackets) divider. Alternatively, you can add a summary to the front matter if you don’t want your summary to be the beginning of your post Customize Description. The value of this field is used as an abstract in your front page and link previews. Add two spaces to create new line after a line end. Otherwise hugo will just continue the line. This is something hard to grasp. Because of this I usually manually review my rendered post with hugo server -D Syntax Formatting Highlighting individual code lines. Example: class Foo { var name = "Jack" } or I can add line numbers: ...

Hugo High Level

This is the 2nd post of “Everything I learned from blogging with Hugo” series Why Hugo? Hugo is a Static Site Generator. Key is the word “static”. It means: A static website is made up of one or more HTML webpages that load the same way every time. Static websites contrast with dynamic websites, which load differently based on any number of changing data inputs, such as the user’s location, the time of day, or user actions. While static webpages are simple HTML files that can load quickly, dynamic webpages require the execution of JavaScript code within the browser in order to render ...

Tips for post creation

This is the 1st post of “Everything I learned from blogging with Hugo” series I started blogging in Dec 2021. It’s been a wonderful journey. Has enabled me to gather my thoughts in a far more structured way. The series is based on my setup of Hugo - Netlify - GitHub. I’ll shared my knowledge in terms of Hugo knowledge, how to write a blog post and more. If anyone is interested in the Netlify setup, see Hugo Quick Start then Netlify - Hugo setup. ...