Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add "Last Edited" to posts #775

trashcatt started this conversation in Ideas
Feb 3, 2022 · 2 comments · 4 replies
Discussion options

I'd like to be able to show the date of the last edit to a post on the post (ideally next to the post date).

Is there an easy way to do this already that I'm just overlooking?

You must be logged in to vote

Replies: 2 comments · 4 replies

Comment options

Not sure if this counts as your definition of easy but you can override the theme's post_meta.html partial (i.e. the template used to generate the metadata line after the page title / description) to include this information, here's how I do it on my website. You can then set the lastmod key in the page frontmatter. When both date and lastmod are defined it'll something like this (well the colour change I applied here is separate)
image

You must be logged in to vote
2 replies
@d4n3sh
Comment options

I was just thinking of doing this today. Thanks! :D

@felipecrp
Comment options

👍I created a PR (#1703) based on this suggestion.

Comment options

To use .Lastmod parameter, you also need to set enableGitInfo: true in your site’s configuration file.

You must be logged in to vote
2 replies
@ichard26
Comment options

You could also set the lastmod source to use :fileModTime instead using Git information like me fwiw.

@beiyuouo
Comment options

Actually, I use GitHub actions to deploy my blog, so the time of filemod is always the deployment time XD. GitInfo is necessary for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
💡
Ideas
Labels
None yet
5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.