Enable RST

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


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.
  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$'