-
-
Notifications
You must be signed in to change notification settings - Fork 364
feat(lastUpdated): introduce last modified author using GitInfo #857
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for hugo-hextra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| @@ -1,9 +1,18 @@ | |||
| {{- $lastUpdated := (T "lastUpdated") | default "Last updated on" -}} | |||
| {{- $by := (T "by") | default "by" -}} | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be easier to format and translate without using "by" since different languages express authorship differently
For example:
• Last updated on 2025-10-11 • Jane Doe
• Last updated on 2025-10-11 — Jane Doe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about a mix?
For the languages that can handle it, add a translation. For the other ones, just add • or — as the default and show it when no translation is available:
| {{- $by := (T "by") | default "by" -}} | |
| {{- $by := (T "by") | default "•" -}} |
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that sounds good.
ideally this should be templated, but we don't have to do it right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay, finally I left the dot because for languages without translation, it was using English as the default, and not the default string as I suggested.
Description
Using the git info that the app already uses to show the last modified date, I have added the last person that modified the page also. This is very util for us when checking who to ask for information about that part of our documentation
How to use it
To activate the feature, I have added a new flag called
displayUpdatedAuthorNOTE: I just translated the languages that I know, I might need some help to translate the by in the phrase: Last updated on {{date}} by {{author}}
Thanks for the great work with this template!