Comments (4)
This is how jekyll does it: https://github.com/jekyll/jekyll-sitemap#lastmod-tag
from sphinx-sitemap.
I happen to have recently created a Sphinx extension that does basically just that: https://github.com/mgeier/sphinx-last-updated-by-git
It's somewhat similar to your own https://github.com/jdillard/sphinx-gitstamp.
Included files may have a later updated date than the parent page.
That's taken care of.
Files included for substitution purposes won't take into account if only a substitution on that page changed, making it hard to determine if the change date on the included files are accurate for that page.
I guess that's still a problem.
Another question is: what happens with auto-generated source files?
Note that index.html
will only be updated when index.rst
changes, not when any of the section titles happen to change. I'm not sure whether that's a problem.
For more caveats see the README.
from sphinx-sitemap.
I've been following along, nice work! I plan on incorporating the relevant bits into my extensions as a learning exercise (part of the reason I made these is to help me get better at Python).
I guess that's still a problem.
As a sub-point to the includes, I need to test if rst_prolog
reacts differently, although I suspect it doesn't. This is how I typically include "global" substitution files:
rst_prolog = """
.. include:: /substitutions.rsti
"""
Another question is: what happens with auto-generated source files?
Note that index.html will only be updated when index.rst changes, not when any of the section titles happen to change. I'm not sure whether that's a problem.
That's a good point as well. While I understand the importance of the accuracy, I wonder if one could argue it is outside the scope of "git timestamps". Ideally, that type of change would be reflected though.
from sphinx-sitemap.
This is an interesting case!
I've just checked, and the included file (in your example substitutions.rsti
) is listed as dependency for each page.
When you update your substitutions.rsti
file, this will be reflected in the dates of each page (if you check for dependencies by default, as I do).
This is what you want, right?
There will always be cases where this is strictly speaking wrong (e.g. if you update your substitutions but a certain page doesn't actually use those changes), but Sphinx simply doesn't provide such fine-grained information about dependencies. But it's good to be aware of the behavior.
I wonder if one could argue it is outside the scope of "git timestamps". Ideally, that type of change would be reflected though.
For now I'm only interested in using the information about dependencies as provided by Sphinx and consider everything else out of scope.
Now that I think about it, one could probably use the source information stored in the "doctree" to have more fine-grained (and/or additional) information. But I'm not sure that would work at all, and I don't want to go down this path right now.
from sphinx-sitemap.
Related Issues (20)
- use html_baseurl instead of custom field
- PyPI build doesn't seem to have latest version HOT 1
- Make sure URLs are escaped
- hreflang syntax invalid for regional language variants
- Doesn't reference pages in subdirectories HOT 5
- Forced URL scheme for multilanguage and multiversion HOT 6
- Sitemap customization for locale paths HOT 1
- Root dir is missing HOT 1
- Sitemap rules not respected for multilingual documentations HOT 1
- Add option to remove file extension from output url's HOT 5
- "default" config broken in sphinx 5 HOT 4
- Provide wheels on new releases HOT 1
- 2.3.0: test suite is installed HOT 1
- html_file_suffix configuration values is not respected HOT 2
- 2.5.0: pytest warnings HOT 3
- Missing slash in sitemap URL scheme when upgrading from sphinx-sitemap 2.2 to 2.3 HOT 2
- Sphinx 6.1.3 error: Sitemap file generates, but with no entries HOT 3
- loading pickled environment is failed, possibly because using `multiprocessing.Manager` HOT 1
- Error with Sphinx 7.2 HOT 6
- Is it possible to remove the generated language, e.g. "/en/" from the generated sitemap URLs? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sphinx-sitemap.