Main Content and Input Formats
As was said in the introduction, content refers to the things that are rendered on websites. The focus in Hugo is on text, written prose form the main content. Additional content and information is added with the help of layouts.
In Hugo the main content is primarily written in Markdown. This standard enables simple and unambiguous markup of headings, italic and bold text, links and other web formatting. The code snippets won’t interfere much with the flow of writing and reading. This is especially true in comparison to HTML, the traditional markup language for the web. The use of markup is largely intuitive, even for technically less experienced users, as evidenced by its widespread use on social media and blogging platforms.
In addition to Markdown, Hugo supports other formats in which main content can be written. Conventional HTML remains possible, and formats such as Emacs Org Mode and AsciiDoc can also be used. Each of these formats has its own advantages and peculiarities.
To give an example: I particularly like the way links are rendered in AsciiDoc. Instead of having to remember which brackets are used for the URL and which for the link text in Markdown, AsciiDoc only puts the link text in brackets: https://asciidoc.org[AsciiDoc]
. For unordered lists, AsciiDoc explicitly specifies the level at which the associated text should be displayed: ** Level 2
.
As Hugo’s default language, working with Markdown comes with some
convenient features. For the sake of simplicity, we will pretend that Markdown is the only format for creating main content. However, when we refer to an _index.md
or similar files, this is always to be understood as representative of all supported file formats.
You do not have to commit to a global input format. If you wish, you can decide which format to use on a file-to-file basis. All these formats can (and must!) also be preceded by front matter. We will discuss this important feature for managing content in detail in a later section.
So far we have talked about file contents as we enter them in a text editor. The following part will deal with the files themselves. In other words, we will manage files at the level of a graphical file explorer or carry out file system-operations via the command line.