How to configure HTML processing in templates
HTML and Markdown options
Anywhere that Markdown or HTML is processed from a content file, the following parameters apply:
- The standard image rendition arguments
absolute
: Set to True to force all links to be absolute (rather than relative); for HTML, this applies to allhref
,src
, and rendition attributes.markup
: Whether to include any markup in the title; defaults toTrue
, but should be set toFalse
where HTML markup isn’t valid.For example, markup isn’t allowed in the HTML
<title>
tag:Nor is it valid in HTML attributes:
For the sake of improving readability, this will also remove the contents of
<del>
and<s>
tags (such as what are rendered by Markdown~~strikethrough~~
); for example, an entry title ofThis is ~~not~~ a test
will render asThis is a test
. If you would like more control over this behavior, use thestrip_html
filter instead.
Markdown-only options
The following options only apply to Markdown content:
smartquotes
: Set toTrue
to enable automatic smartquote substitution, orFalse
to disable it (necessary in e.g. Atom feeds). Defaults toTrue
.no_smartquotes
: The opposite ofsmartquotes
, provided for backwards compatibility; ifsmartquotes
is set then this is ignored.markdown_extensions
: A list of extensions to configure the Markdown formatter with; defaults to the global configuration.xhtml
: Set toTrue
to render as XHTML instead of HTML (default:False
)
Note that an entry’s title is always treated as Markdown, even if the entry itself is HTML.