sphinx-last-updated-by-git icon indicating copy to clipboard operation
sphinx-last-updated-by-git copied to clipboard

Show Commit Hashes

Open bebehei opened this issue 1 year ago • 5 comments

I'm currently misusing html_last_updated_fmt for my whole project and set it for the whole project. (Source)

git_cmd = "git log --pretty=format:'%ad, commit %h' --date=local -n1"
html_last_updated_fmt = os.popen(git_cmd).read()

This shows the same date and commit on all pages.


While using this repository, the commit information is completely gone. As far as I can see in the code, it should be easily retrievable, since you're already working with commit hashes all the time.

I've replaced this for now with your repo. But the Revision is now missing.

https://github.com/mgeier/sphinx-last-updated-by-git/blob/d9037a358aaee37a6a6cc2ea1d939ed17eca6d94/src/sphinx_last_updated_by_git.py#L226-L227

Could you add there also a revision (the commit hash) into the html contex, too?

Popular Themes could pick this up then automatically:

https://github.com/readthedocs/sphinx_rtd_theme/blob/0da22b885be387b79f7552c92be00fd14d11228a/sphinx_rtd_theme/footer.html#L27-L43

bebehei avatar Dec 28 '23 12:12 bebehei