-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
feat: old content warning #266
Conversation
Forgot to mention but thanks to https://brunty.me/post/display-message-on-old-hugo-entries/ for the original code. @lxndrblz @SchabrechtsK please let me know if this implementation is okay and please help me with styling. I'm not sure what will look good. Right now the text is inserted right above the content, without any visual distinction which might look odd. |
@ericswpark Thanks! I'll take care of the CSS styling. |
I changed the implementation so it now displays the age of the post rather than the duration cutoff, which looks better IMHO at conveying the age of the post. Also moved the string to i18n. Should we consider allowing users to customize the outdated content message shown? Or should we just display the generalized outdated statement? |
This reverts commit 43a1368.
This can be overriden using the parameter in the front matter of the page, if desired.
@ericswpark I would leave it a default message and not customizable. Personally, I would change the wording to include the value set in the old content duration and emphasis the "over", because the problem of this static approach is that if a user does not rebuild their sites daily, the information would be incorrect. |
@ericswpark Just pushed some basic CSS styling: What do you think? |
I haven't even considered that! I'll change it back to the original wording.
Looks good. Maybe we can make it yellow-colored to better distinguish it as a warning on the page. |
@lxndrblz here's the alert with the new changes:
Also added fix for redefined post section name. |
We should also add the remaining translations before this goes live. |
@lxndrblz wouldn't it be better to make it a pinned issue? Translators can't tack on translation commits to this PR unless they are a maintainer of the repository and getting all the translations in will take a lot of time unless we can contact all the previous translators. Since the feature is disabled by default I think translations will trickle in as people enable it and see that there is no translated string. |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
@ericswpark LGTM! Thanks for all your help.
Very nice! Thanks for the hard work @ericswpark ! |
WIP, needs styling on the alert div. Basic functionality works
Closes #250