Using reStructuredText (RST) markup in a Hugo site requires some configuration on your local machine and in your deployment solution (Netlify, AWS Amplify, a container image).
Once set up, you will be able to use full .rst
pages, write inline RST using the rst shortcode, and/or create your own markup shortcodes.
Before you start #
- Read about Hugo’s security model
- Read about Hugo’s AsciiDoc configuration options
How to enable RST markup #
We tested the following steps with Netlify. By providing a
requirements.txt
file at the root level, Netlify automatically installs python
, pip
, and the listed dependencies (rst2html
). This may not be the case in your deployment solution.
-
Install Python.
-
Install
rst2html
.pip install rst2html
-
Create a
requirements.txt
file at the root of your Hugo project and add the following:rst2html
-
Update your Hugo configuration values at
security.exec.allow
. We need to whitelist the RST processor tool asrst2html
andrst2html.py
.exec: allow: - '^dart-sass-embedded$' - '^go$' - '^npx$' - '^postcss$' - '^rst2html.py$' - '^rst2html$' - '^asciidoctor$'