Add a "Last Updated" field to .md pages

414 views
Skip to first unread message

Thatman84

unread,
Apr 27, 2018, 3:46:03 PM4/27/18
to MkDocs
Trying to do a little research to help out on an open source documentation site I contribute to.
Would be great to have a "Documentation last updated dd/mm/yyyy)" field link to the github changes.

See image in this git issue https://github.com/libretro/docs/issues/44

How would one takle this?

Waylan Limberg

unread,
Apr 30, 2018, 8:58:37 PM4/30/18
to MkDocs
The page template gets a build_date_utc variable which can be used to include the build date on pages. In fact the MkDocs theme uses this variable to include the build date on every page in a comment (the comment causes the date to not be displayed). You could use theme customization to alter a theme and include the date elsewhere on pages.

Waylan

Thatman84

unread,
May 1, 2018, 5:43:02 AM5/1/18
to MkDocs
Thank for the reply. I did find this open issue on mkdocs https://github.com/mkdocs/mkdocs/issues/1408

If im understanding it correctly the build date you reference is a single date for all pages of a site?

Waylan Limberg

unread,
May 1, 2018, 1:06:47 PM5/1/18
to MkDocs
Yes that is correct. One date for all pages. If you want something else, then that would be very specific to your projects needs and setup and would be a good candidate for a plugin.

Waylan

Thatman84

unread,
May 1, 2018, 6:31:44 PM5/1/18
to MkDocs
Thanks for confirming....As I lack the skill for creating a plugin and the Libretro guys that do are busy doing other projects I will just keep an eye on the open issue. Hopefully someone with the skills picks up the idea.
Reply all
Reply to author
Forward
0 new messages