Open bartvanderwal opened 4 weeks ago
The first issue should be easy to handle: when the filename is index.html
(or index.md
? whatever mdbook gives us...) look for README.md
too (now what to do about all the different casings of that ...).
A check somewhere here might be the way to do it: https://github.com/badboy/mdbook-last-changed/blob/4f5518a1bd8d06bf3ab79d9318ea7da5133cbf68/src/lib.rs#L94
Your last-changed-text
request seems appropriate, but please split it out into a separate issue.
The sitemap request: Nah, that's out of scope for this simple preprocessor. I don't want to maintain that. So if you need that feel free to fork and add the functionality yourself.
Great repo! This helped me achieve what I wanted too for a large part, without needing to build it myself.
I have three feature requests though of which the first one might be considered a bug report. And the main one.
Last change
inREADME.md
files, which mdbook automatically converts toindex.html
on building. See for instance in the mdbook codebase here. I suppose as a work-around I could rename all these files toindex.md
, but then they aren't shown in GitHub anymore by default. Could mdbook-lastchange retrieve the last change date in git of aREADME.md
'a and use/insert that on the matchingindex.html
?TL; DR / Other suggestions
I might look at these other two suggestions myself. Perhaps should make another separate issue(s) for them.
Edit 9-11-2024: Suggestion 2 below was moved to issue #11 , and suggestion 3 was denied, might be a possible fork.
The text
Last changed: 2021-11-05
is fine as a default, but could it also be made configurable, so I can localize it for Dutch? For instance a second settinglast-changed-text
besidesgit-repository-url
. Ideally also with a variable position of the date. So you could also change it to a more verbose "This page was last changed on 2024-22-12" to make explicit that the data is per page, and not per website. "Diese Seite wurde zuletzt am 2024-22-12 geändert"It would be great - and I think also pretty logical - if this plugin could also generate a
sitemap.xml
file of all the pages and use the determined dates as value for thelastmod
property. The existingmdbook-generate-sitemap
creates a sitemap, but is missing thelastmod
valuea, but also seems to be a bit abandoned, or never really to have left the ground, as Google webmaster tools finds immediate errors. And the repo has this issue reported for it, but also an open pull request with a fix for it thas is open and unmerged for 10 months.Here is an small example of a
sitemap.xml