hugo/docs/content/en/content-management/formats.md
Bjørn Erik Pedersen bfb9613a14
Add Goldmark as the new default markdown handler
This commit adds the fast and CommonMark compliant Goldmark as the new default markdown handler in Hugo.

If you want to continue using BlackFriday as the default for md/markdown extensions, you can use this configuration:

```toml
[markup]
defaultMarkdownHandler="blackfriday"
```

Fixes #5963
Fixes #1778
Fixes #6355
2019-11-23 14:12:24 +01:00

4.6 KiB

title linktitle description date publishdate lastmod categories keywords menu weight draft aliases toc
Content Formats Content Formats Both HTML and Markdown are supported content formats. 2017-01-10 2017-01-10 2017-04-06
content management
markdown
asciidoc
mmark
pandoc
content format
docs
parent weight
content-management 20
20 false
/content/markdown-extras/
/content/supported-formats/
/doc/supported-formats/
true

You can put any file type into your /content directories, but Hugo uses the markup front matter value if set or the file extension (see Markup identifiers in the table below) to determine if the markup needs to be processed, e.g.:

  • Markdown converted to HTML
  • Shortcodes processed
  • Layout applied

List of content formats

The current list of content formats in Hugo:

Name Markup identifiers Comment
Goldmark md, markdown, goldmark Note that you can set the default handler of md and markdown to something else, see Configure Markup.{{< new-in "0.60.0" >}}
Blackfriday blackfriday Blackfriday will eventually be deprecated.
MMark mmark Mmark is deprecated and will be removed in a future release.
Emacs Org-Mode org See go-org.
Asciidoc asciidoc, adoc, ad Needs Asciidoc or Asciidoctor installed.
RST rst Needs RST installed.
Pandoc pandoc, pdc Needs Pandoc installed.
HTML html, htm To be treated as a content file, with layout, shortcodes etc., it must have front matter. If not, it will be copied as-is.

The markup identifier is fetched from either the markup variable in front matter or from the file extension. For markup-related configuration, see Configure Markup.

External Helpers

Some of the formats in the table above needs external helpers installed on your PC. For example, for Asciidoc files, Hugo will try to call the asciidoctor or asciidoc command. This means that you will have to install the associated tool on your machine to be able to use these formats. (See the Asciidoctor docs for installation instructions).

Hugo passes reasonable default arguments to these external helpers by default:

  • asciidoc: --no-header-footer --safe -
  • asciidoctor: --no-header-footer --safe --trace -
  • rst2html: --leave-comments --initial-header-level=2
  • pandoc: --mathjax

{{% warning "Performance of External Helpers" %}} Because additional formats are external commands generation performance will rely heavily on the performance of the external tool you are using. As this feature is still in its infancy, feedback is welcome. {{% /warning %}}

Learn Markdown

Markdown syntax is simple enough to learn in a single sitting. The following are excellent resources to get you up and running: