-
-
Notifications
You must be signed in to change notification settings - Fork 72
feat: add last updated date to blog posts #692
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
Conversation
✅ Deploy Preview for pt-br-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for ja-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for es-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for de-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for zh-hans-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for fr-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for hi-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for new-eslint ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Thanks for taking a look at this.
Can you move the updated date/time to the left column? It doesn't look very good as another line at the top.
.eleventy.js
Outdated
@@ -22,6 +22,7 @@ const path = require("node:path"); | |||
const fs = require("node:fs"); | |||
const yaml = require("js-yaml"); | |||
const { DateTime } = require("luxon"); | |||
const { execSync } = require("node:child_process"); |
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.
Is there not some way built into Eleventy to get the updated date/time? This feels a bit heavy to me.
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.
Yes, that looks good. 👍 |
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.
there is no border between the author's detail and last updated date section for small screen size can you fix that?
Also proposal in #612 says
It would enhance the user experience if the last updated date of the blog post were displayed somewhere on the page, allowing users to quickly see when it was last updated, rather than having to scroll down to the bottom of the page to check the update history.
and for small screen sizes we still have to scroll down to the bottom of the page, should we also add this date in header for small screens?
Thanks for the reviews! I appreciate the feedback. I'm happy with the current design and will wait for Nicholas's input before making any changes. |
@Tanujkanti4441 no, I don't think that necessary. @Pixel998 I like @amareshsm's design. He's on our website team so he's a good resource to work with. |
Sounds good. @amareshsm, got a couple of questions for you:
|
We should use the same date format as the publish date. 👍 Just a reminder: I don't think using |
Closing this for 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.
LGTM. Just left one comment about script naming but otherwise seems ready.
Would like another review before merging.
"2014-01-19-breaking-change-formatter.md": "2022-02-05T06:13:45.000Z", | ||
"2014-01-20-breaking-change-config-file.md": "2022-02-05T06:13:45.000Z", | ||
"2014-01-20-eslint-0.3.0-released.md": "2022-02-05T06:13:45.000Z", | ||
"2014-02-12-eslint-0.4.0-released.md": "2022-02-05T06:13:45.000Z", | ||
"2014-03-03-eslint-0.4.2-released.md": "2022-02-05T06:13:45.000Z", | ||
"2014-03-18-eslint-0.4.3-released.md": "2022-02-05T06:13:45.000Z", | ||
"2014-03-25-eslint-0.4.4-released.md": "2022-02-05T06:13:45.000Z", | ||
"2014-03-29-eslint-0.4.5-released.md": "2022-02-05T06:13:45.000Z", | ||
"2014-04-10-eslint-0.5.0-released.md": "2022-02-05T06:13:45.000Z", | ||
"2014-04-17-eslint-0.5.1-released.md": "2022-02-05T06:13:45.000Z", |
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.
Looks like blog posts copied over from the old website repo (https://github.com/eslint/archive-website) will have the update date 2022-02-05
, which I think would be misleading. Perhaps we could get the last updated date from the old website repo, or maybe just use the publish date as the last updated date for these posts?
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.
Good catch. 👍 to using the publish date as the last updated date.
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.
Perhaps we could get the last updated date from the old website repo
These dates do reflect the last updated dates from the old website repo unless I am misunderstanding something here?
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 see, there was a commit eslint/archive-website@5aa1575 that fixed the authors on that date.
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.
Now, I think this raises a question: Does any change to the blog post's source file constitute an update worth showing in the blog post? I think readers would be interested in factual changes to the content, not e.g., authors, labels, etc.., maybe not even fixing small typos in the text. Since we rarely update the content of blog posts, I'd be in favor of manually updating this date rather than automatically in pre-commit.
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.
My thoughts exactly!
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.
@mdjermanovic what do you think?
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.
Okay, we can always undo the date change directly in the PR if we don't want to modify the date based on the kind of change in the blog post file.
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.
As for the old blog posts, I still think that fixing the authors shouldn't be considered an update that changes the date.
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.
As for the old blog posts, I still think that fixing the authors shouldn't be considered an update that changes the date.
I agree. I think that will be a rare case going forward, so if we can just set those back to the publish date, I think we'll be good to go.
Ping @mdjermanovic |
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. Would like @mdjermanovic to verify before merging.
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, thanks!
Prerequisites checklist
What is the purpose of this pull request?
The purpose of the pull request is to add a "last updated" date to blog posts.
What changes did you make? (Give an overview)
I added a "last updated" date to each blog post.
Related Issues
Fix #612
Is there anything you'd like reviewers to focus on?