Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

last_updated gone in footer ? #238

Closed
Carreau opened this issue Sep 3, 2015 · 11 comments · Fixed by #897
Closed

last_updated gone in footer ? #238

Carreau opened this issue Sep 3, 2015 · 11 comments · Fixed by #897
Labels
Needed: design decision A core team decision is required

Comments

@Carreau
Copy link
Contributor

Carreau commented Sep 3, 2015

#208 seem to have made last_updated in footers visible only in last resort.

Can it be added in addition to the revision number as revision number are nice for developers, but pretty useless for user that just want to know how old docs are ?

If so I can make a PR.

@agjohnson
Copy link
Collaborator

We had plans to link the hash to the RTD build object, or it could link back to the github commit via the hash -- maybe that would be better? It would give the closest approximation of the time the file was edited, and not just the time the file was generated on RTD.

If we can give a short hash from RTD (on the roadmap, I don't think there's a ticket), I don't see much of a problem in appending the date as well. Less redundant info down there the better, I suppose. It got bumped orignally because there was too much going on at the bottom of the page.

We could also use a configuration option here, though I don't know if that would be polluting our configuration option namespace or not.

@Carreau
Copy link
Contributor Author

Carreau commented Sep 9, 2015

or it could link back to the github commit via the hash

If you have the commit hash, you could have the commit date, no ?

And you could have a date, which link to the commit.
That would make things compact, easy to read, and with access to more info if needed.

It got bumped orignally because there was too much going on at the bottom of the page.

Yep, I understand.

I basically like to know when I land on a page if the doc build is from today, last week, last month, or last year, so that I can get an idea of wether the docs are autobuilding/maintained.

I suppose you know about it, but a nice way to format date is momentjs.

Thanks !

@ghost
Copy link

ghost commented Jan 23, 2017

Are 'last updated dates' ever coming back to the stock theme? I'm not quite sure how I can add this in without making a fork of the module. Is there a simple way to get this back?

@Blendify Blendify added the Needed: design decision A core team decision is required label Dec 17, 2017
@Moini
Copy link

Moini commented Aug 11, 2018

I like the suggestion by @Carreau, it would make it a lot easier for contributors to documentation to see if their changes have taken effect, and for users to see how old the docs are. The commit hash is not useful for this at all. If the date can then be linked to the commit, this would be perfect, and eliminate the need (or longing) for a custom theme for many.

@thomas-nilsson-irfu
Copy link

Is there any progress on this issue at all or has is completely died out?

It should not be too difficult to allow for generated documentation to simply include the dates and the commit hash (if the author would like for it to be so), or? Instead of forcing the author to choose one and only one of these to show.

This could possibly be set with some simple if-statement, similar to how the copyright is handled:

{%- if show_copyright %}
{%- if hasdoc('copyright') %}
{% trans path=pathto('copyright'), copyright=copyright|e %}&copy; <a href="{{ path }}">Copyright</a> {{ copyright }}{% endtrans %}
{%- else %}
{% trans copyright=copyright|e %}&copy; Copyright {{ copyright }}{% endtrans %}
{%- endif %}
{%- endif %}

@Blendify
Copy link
Member

Blendify commented Jul 9, 2019

This works simply add html_last_updated_fmt = '%m/%d/%Y' to your conf.py

@Blendify Blendify closed this as completed Jul 9, 2019
@eine
Copy link

eine commented Jul 9, 2019

@Blendify, this issue is about showing the date AND the commit hash:

Can it be added in addition to the revision number

include the dates and the commit hash (...) Instead of forcing the author to choose one and only one of these to show.

Is the commit hash added automatically when the user sets html_last_updated_fmt = '%m/%d/%Y'? See https://github.com/readthedocs/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/footer.html#L32-L42

@Blendify Blendify reopened this Jul 9, 2019
mgeier added a commit to mgeier/homepage that referenced this issue Apr 8, 2020
@mgeier
Copy link
Contributor

mgeier commented Apr 8, 2020

@Blendify

This works simply add html_last_updated_fmt = '%m/%d/%Y' to your conf.py

It doesn't work on https://readthedocs.org/, though, because they forcefully set the html_context['commit'] value.

I've just created a Sphinx extension that takes the last_updated information from Git (individually for each source file): https://github.com/mgeier/sphinx-last-updated-by-git

Sadly, it doesn't work on RTD because of this issue.

I think it would be reasonable (as already suggested multiple times above) to show both the commit hash and the last changed date.

@mgeier
Copy link
Contributor

mgeier commented May 26, 2020

Any news on this?
What about a design decision?

The solution is only a click away: #897

mgeier added a commit to mgeier/sphinx_rtd_theme that referenced this issue Jul 7, 2020
@agjohnson
Copy link
Collaborator

Noted at #897 (comment) but the main issue that RTD will have with using last_updated is that we rebuild every file every build. last_updated will always be the date of the last project build, for every file.

So, for a design decision, I think a link to the commit is (currently) more truthy than always showing last_updated, but would 100% love to have the last commit date of the source file if we had it available.

@mgeier
Copy link
Contributor

mgeier commented Jul 21, 2020

Noted at #897 (comment), displaying the "last updated" date is an opt-in mechanism.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: design decision A core team decision is required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants