markup: identifier
Ongoing
According to
Repology,
the latest
packaged Hugo
is
.
2022-July-5
As of today, this evolving[1]
article
has been on
the web
for
2022-May-31 Hugo v0.100.0 released and, as of this version, the Blackfriday built-in Markdown renderer is removed.
2022-January-12 Hugo v0.92.0 released and, as of this version, the Mmark built-in Markdown renderer is removed.
2021-October-22 Joe Mooring (@jmooring) posted GitHub Issue #9074: Mismatch between content format providers and file extensions. This issue is related to the file extensions discussed in this article.
Hugo versions 0.60.0[2] and newer include support for the following markup languages.
File Extensions (non-extension identifier) | Markup Language | Built-in Renderer |
---|---|---|
| ✔︎ | |
|
|
|
|
|
|
| ✔︎ | |
| ✔︎ | |
✘︎ | ||
| Pandoc | ✘︎ |
| ✘︎ |
To use one of
the last three markup languages,
you
need to install an external
helper,
for example
asciidoctor
,
pandoc
,
or
rst2html
.
Hugo determines the markup language of a content file that has one of the above file extensions[8] from…
a markup
key-value pair in the file’s front matter
or
the file’s file extension
The first of these found wins. This means you can override the default meaning of a file extension by putting the following in the YAML front matter of a content file.
markup: identifier
Or the following in the TOML front matter of a content file.
markup = "identifier"
Possible markup identifiers[9] are in the first column of the table above. In other words, you can put one of the following in the YAML front matter of a content file.
markup: ad markup: adoc markup: asciidoc # v0.73.0- (bug) markup: asciidocext # v0.74.0+ markup: blackfriday # v0.60.0 – v0.99.1 markup: goldmark # v0.60.0+ markup: markdown markup: md markup: mdown markup: mmark # v0.91.2- markup: htm markup: html markup: org # v0.19+ markup: pandoc markup: pdc markup: rst
It’s fine to use multiple markup languages in a single Hugo-generated project. For example, this Infinite Ink website includes content written in…
AsciiDoc (this page),
Goldmark-flavored Markdown (Ordinary and Extraordinary Markdown),
Org-mode Markup (Org-Mode Markup Kitchen Sink)
Pandoc-flavored Markdown (Links and Footnotes in Markdown),
and HTML (Cardinal Numbers).
It’s possible to use multiple markup languages in a single Hugo-generated page. To learn about this see Infinite Ink’s A Way to Compare Hugo’s Markup Languages.
If you want Hugo to process a content file, it must have front matter. If you do not need to specify metadata, use empty front matter, for example this empty YAML front matter:
--- --- Begin writing markup here.
Or this empty TOML front matter:
+++ +++ Begin writing markup here.
In
Hugo
v0.60.0[2]
and newer, the default Markdown renderer is
Goldmark.
You can override this for your entire site by putting
the following
nested map[10]
in
your site’s config.yaml
.
markup: defaultMarkdownHandler: identifier
Or the following in your config.toml
.
[markup] defaultMarkdownHandler = "identifier"
identifier
can
be
pandoc
or another Markdown handler that
your version of
Hugo supports.
ℹ |
|
In Hugo v0.59.1 and older…
the default Markdown renderer is Blackfriday,
a markup
key-value pair
is recognized in the front matter of a content file, but
the identifiers
blackfriday
,
goldmark
,
and
asciidocext
[7]
are not available
as values of
this
key,
and a markup
nested map
is not recognized in a config
file (this
site variable
was introduced in v0.60.0).
To learn more about Hugo’s support for markup languages, see the following.
gohugo.io:
ii.com:
“ox-hugo is an Org exporter backend that exports Org to Hugo-compatible Markdown and also generates the front-matter (in TOML or YAML format).”
If you install…
R,
and the blogdown R package,
which is a wrapper around hugo
,
you can create
R Markdown (.Rmd
) files that
blogdown
— along with hugo
— will render
to HTML.
The
blogdown package installs and
uses
rmarkdown
, bookdown
, and pandoc
to render .Rmd
files.
For more about this, see:
R Markdown
Pandoc
For more about Hugo, see Infinite Ink’s…
Hugo’s .RenderString
Method (featuring AsciiDoc admonitions in Markdown and Go HTML)
Variable and Parameter Names in Hugo (featuring camelCase🐫 and snake_case🐍)
🔗 Linkified Section Headings in Hugo-Generated Web Pages (featuring Markdown and AsciiDoc examples)
A Way to Compare Hugo’s Markup Languages (featuring inline footnotes)📊
Configuring Security in Hugo (featuring settings needed to use Asciidoctor and Pandoc)🔒
Hugo Shortcodes: Including Go Templates in Hugo Content Files
Transforming Text with Hugo (featuring plainify
, htmlUnescape
, and more)
.markd
, .mdn
, or .mkd
. This way you and your text editor will interpret it as a Markdown file, but Hugo won’t. I do this with backup and other Markdown files that I do not want Hugo to process. For a discussion about this, see Avoid rendering of specific .md files from blogdown::serve_site() at stackoverflow.com.go-org
. Hugo versions v0.19–v0.55.6 use goorgeous
. Discussion about this in this issue..asciidoc
used to work but at some point (maybe v0.74.0) it quit working, which is probably a bug.content/
directory, a file with one of the following file extensions will be interpreted by hugo
as containing a known markup language: .ad
, .adoc
, .htm
, .html
, .markdown
, .md
, .mdown
, .org
, .pandoc
, .pdc
, or .rst
.@nm@mathstodon.xyz
or
#InfiniteInk
in it.