Enable RST

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


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.
  1. Install Python.

  2. Install rst2html.

    pip install rst2html
  3. Create a requirements.txt file at the root of your Hugo project and add the following:

    rst2html
  4. Update your Hugo configuration values at security.exec.allow. We need to whitelist the RST processor tool as rst2html and rst2html.py.

    exec:
      allow:
        - '^dart-sass-embedded$'
        - '^go$'
        - '^npx$'
        - '^postcss$'
        - '^rst2html.py$'
        - '^rst2html$'
        - '^asciidoctor$'