To utilize reStructuredText (RST) markup in a Hugo site, some extra configuration is required — both 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 #
The following steps have been tested with Netlify. By providing a
requirements.txt
file at the root level, Netlify knows to automatically install 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$'