-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add $page.lastUpdatedTstamp #1778
Conversation
Hello @psi-4ward ! Thank's for you PR |
@@ -10,6 +10,7 @@ module.exports = (options = {}, context) => ({ | |||
? transformer(timestamp, $lang) | |||
: defaultTransformer(timestamp, $lang) | |||
$page.lastUpdated = lastUpdated | |||
$page.lastUpdatedTstamp = timestamp |
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 we can add the full name here lastUpdatedTimestamp lastUpdatedTimeStamp for me it could a lot more clearer
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.
Imho is tstamp a very common term for the Unix (like) time stamp but I will adjust it
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.
Maybe others can answer too. Actually i dont see any short write of variable inside vuepress.
Updated to |
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.
Hi @psi-4ward
Thanks for this PR.
Why would you need to access the timestamp as you can already change the date format through a custom transformer ?
The transformer gets used to format |
What you mean is that you need to have two types of date format in the same page right? |
What you want seems very specific to your need. Could theme inheritance solve your problem? |
Not necessarily in the same page. More generic there sould be a possibility to have the date in a machine-readable format. The sitemap-plugins generates a XML of all pages with ISO-Date of the laste-updated date. Another usecase would be a smth like an article-list (blog) with dates like "1 day ago". |
Hello! We get a lot of issues, so we currently close issues requiring feedback after 20 days of inactivity. It’s been at least 10 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. (A maintainer can also add the label Thanks for being a part of the Vue community! 💪💚️ |
Hey again! 😸️ It’s been 20 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Thanks again for being part of the Vue community! 💚️ |
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.
Could you help update the relevant documentation?
Issue still valid: ekoeryanto/vuepress-plugin-sitemap#11 |
Can you give me a hint where to document this? |
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.
LGTM
Summary
What kind of change does this PR introduce? (check at least one)
If changing the UI of default theme, please provide the before/after screenshot:
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx]
, where "xxx" is the issue number)You have tested in the following browsers: (Providing a detailed version will be better.)
If adding a new feature, the PR's description includes:
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information:
The
$page.lastUpdated
generated from plugin-last-updated helds the Date in the localized format. Other plugins like sitemap can hardly work with this value in a mathematics manner so it's necessary to also expose the Timestamp.See ekoeryanto/vuepress-plugin-sitemap#11