Search code examples
configuration-filespython-sphinxread-the-docs

Why doesn't ReadTheDocs show "Last updated on"


I have a documentation rendered by and hosted on ReadTheDocs. It still shows the Git commit hash instead of the "Last updated on" line, whereas my local HTML documentation shows today's date.

Local version: enter image description here

Online version: enter image description here

In the docs/conf.py file, I configured html_last_updated_fmt to a non None value -> empty string.
Source: https://github.com/VLSI-EDA/PoC/blob/master/docs/conf.py#L173-L176

Why is ReadTheDocs ignoring my setting? How can I get the last updated date?


Solution

  • The ReadTheDocs default theme replaces the Last updated information with the revision info, if a revision info is available (here's the commit that introduced the change).

    To fix this, you can create and use a custom theme. This is not trivial. Proceed as follows:

    • Fork the ReadTheDocs theme.
    • "Undo" the changes of the commit I referenced above.
    • Reference the fork in your documentation's requirements file. Here, you can see an example of a requirements file. However, the file should typically be in the root directory of your repository and have the name requirements.txt.
    • Make sure your project is configured to support the installation of custom requirements.
    • Push all changes to GitHub.
    • Rebuild your project on ReadTheDocs.