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: ...