I have been able to test it and it works fine. Thank you very much, El martes, 21 de julio de 2020 a las 19:55:28 UTC+2, matthia...@gmail.com escribió:
> > Dear Mr. I have been testing your solution and the template but it > doesn't work for me. I want to see in each rst file the last modification > date. If you can explain more I would appreciate it > > Sure, here is a little example: > > * make sure the sphinx-last-updated-by-git package is installed (e.g. with > pip) > > * add this to your conf.py: > > > extensions = [ > 'sphinx_last_updated_by_git', > ] > templates_path = ['_templates'] > > > * create a directory named _templates in your source directory (where > conf.py lives) > > * inside this new _templates directory, create a file named page.html > (so the path is _templates/page.html) with the following content: > > > {% extends "!page.html" %} > {% block body %} > <div class="my-date"> > This page was last updated on {{ last_updated }}, > have fun reading it! > </div> > {{ super() }} > {% endblock %} > > > * run Sphinx > > This should insert a sentence with the "last updated" date at the top > of each page. > If you want it to appear at the bottom, just insert the text below the > "super()" line. > > You can of course use arbitrary HTML and CSS to make it look however you > like. > > If you want to change the date format, you can use the > html_last_updated_fmt setting > ( > https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_last_updated_fmt > ). > > I hope this helps! > > cheers, > Matthias > -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/ea7d71c7-459d-4bc9-9b9e-aabe216af4c9n%40googlegroups.com.