Skip to content
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

Set "Last Updated" by Hugo #89

Merged
merged 3 commits into from
Feb 21, 2023
Merged

Set "Last Updated" by Hugo #89

merged 3 commits into from
Feb 21, 2023

Conversation

bilgeyucel
Copy link
Collaborator

Hugo has a feature to get the latest commit that to certain file. After this PR is merged, all tutorials will have the date of the last commit as the last updated date.

Note: All tutorials will have the same last updated date at first, as all tutorial files will be updated by removing `last_updated from the frontmatter.

@vercel
Copy link

vercel bot commented Feb 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
haystack-home ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Feb 20, 2023 at 2:21PM (UTC)

@TuanaCelik
Copy link
Member

To me this looks ok, let's just see what @carlosgauci thinks as the Hugo expert. Approving for now 👍🏽

Copy link
Collaborator

@carlosgauci carlosgauci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, the only issue I can think of is that since the last updated time can be used to sort the tutorials, a tutorial will show as last updated even if you just update something trivial, so if you go back after a few months just to slightly change the description, won't the tutorial be listed as last updated even though the content isn't really updated for the reader?

@bilgeyucel
Copy link
Collaborator Author

Looks good to me, the only issue I can think of is that since the last updated time can be used to sort the tutorials, a tutorial will show as last updated even if you just update something trivial, so if you go back after a few months just to slightly change the description, won't the tutorial be listed as last updated even though the content isn't really updated for the reader?

Hey @carlosgauci, this might be an issue in the future. However, currently, even if there is a small change in the tutorial, as we generate a new md, we update the date, unless we revert the date manually. So, for now, we can go with this approach, and if it doesn't work, we can add custom_last_updated attribute to tutorial frontmatter. So, in the frontend, it can be {{ with or (.Lastmod) (.Params.custom_last_updated) }}

@bilgeyucel bilgeyucel merged commit 060f500 into main Feb 21, 2023
@bilgeyucel bilgeyucel deleted the last-update-info branch February 21, 2023 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants