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

✨ feat: add date visibility options to post list #330

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

sam9032
Copy link

@sam9032 sam9032 commented Jun 14, 2024

Summary

This pull request adds an option to the config.toml to change the displayed dates on the bloglist.

Related issue

#326

Changes

config.toml

# There are three options to display dates on the bloglist. The bloglist is used on the frontpage and the blog site.
# Use one of the three options.
# Shows the "Last updated on" date
bloglist_date = "updated"
# Shows the creation date
# bloglist_date = "date"
# Shows both dates
# bloglist_date = "both"

Accessibility

Screenshots

See the dates on the left side

Option bloglist_date = "updated":

option updated

Option bloglist_date = "date":

option date

Option bloglist_date = "both":

option both

Type of change

  • Bug fix (fixes an issue without altering functionality)
  • New feature (adds non-breaking functionality)
  • Breaking change (alters existing functionality)
  • UI/UX improvement (enhances user interface without altering functionality)
  • Refactor (improves code quality without altering functionality)
  • Documentation update
  • Other (please describe below)

Checklist

  • Undo demo-setting for config.toml (post_listing_date should be "date")
  • I have verified the accessibility of my changes
  • I have tested all possible scenarios for this change
  • I have updated theme.toml with a sane default for the feature
  • I have made corresponding changes to the documentation:
    • Updated config.toml comments
    • Updated theme.toml comments
    • Updated "Mastering tabi" post in English
    • (Optional) Updated "Mastering tabi" post in Spanish
    • (Optional) Updated "Mastering tabi" post in Catalan

@sam9032 sam9032 requested a review from welpo as a code owner June 14, 2024 22:40
Copy link

netlify bot commented Jun 14, 2024

Deploy Preview for tabi-demo ready!

Name Link
🔨 Latest commit c550195
🔍 Latest deploy log https://app.netlify.com/sites/tabi-demo/deploys/66749a78ee7b290008167db9
😎 Deploy Preview https://deploy-preview-330--tabi-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sam9032
Copy link
Author

sam9032 commented Jun 14, 2024

There are still open tasks:

  • documentation
  • rss / atom site that implements the new options

sass/parts/_posts_list.scss Outdated Show resolved Hide resolved
@welpo
Copy link
Owner

welpo commented Jun 17, 2024

Thanks for working on this!

I've:

  • sorted the CSS
  • simplified the logic a bit (avoiding duplication)
  • used the i18n string
  • renamed option to post_listing_date
  • updated theme.toml to match config.toml
  • rephrased config.toml comments/docs

I have also changed the formatting a bit, removing the separator.

Before

pre

After

post

I think this looks cleaner. What are your thoughts?


An alternative that looks even cleaner, to my eyes, without any losses, is changing "Last updated on" to "Updated on". The message is the same, but it looks neater:

post2

This would require changing all i18n strings (I'd do that on another PR), and I could use the opportunity to use string substitution, as not all languages use the $updated_string + $date format, but rather $date + $updated_string.


What are your thoughts on the current redesign (sans the separator)? And how about the shortened version ("Updated on" instead of "Last updated on"?

@welpo welpo changed the title Add an option to display dates on the bloglist. ✨ feat: add date visibility options to post list Jun 17, 2024
@sam9032
Copy link
Author

sam9032 commented Jun 17, 2024

Thank you!

What are your thoughts on the current redesign (sans the separator)?

With a wide screen this would be my preferred design too but I don't like the design on smaller screens. That was the reason I added the separator:

Site on mobile screen

And how about the shortened version ("Updated on" instead of "Last updated on"?

I like that one!

@welpo
Copy link
Owner

welpo commented Jun 17, 2024

With a wide screen this would be my preferred design too but I don't like the design on smaller screens. That was the reason I added the separator

Aah great catch! I'll do a separator only for mobile/narrow screens, then!

@welpo
Copy link
Owner

welpo commented Jun 17, 2024

Done! I've modified config.toml so you can see it live on the demo: https://deploy-preview-330--tabi-demo.netlify.app/

@sam9032
Copy link
Author

sam9032 commented Jun 17, 2024

It is looking great now. Thank you!

@sam9032
Copy link
Author

sam9032 commented Jun 17, 2024

There is an error now, if there is no "updated" date in the blog post 🤔

@welpo
Copy link
Owner

welpo commented Jun 17, 2024

Thanks for the catch and fix!

@welpo
Copy link
Owner

welpo commented Jun 17, 2024

I'll try to do some thorough testing and write the docs this week, then we can merge :)

@welpo
Copy link
Owner

welpo commented Jun 20, 2024

There are still open tasks:

* documentation

* rss / atom site that implements the new options

Done! You can see it in the PR demo.

Could I ask you to do some final testing, trying to break the feature, before we merge?

@sam9032
Copy link
Author

sam9032 commented Jun 21, 2024 via email

@welpo
Copy link
Owner

welpo commented Jun 21, 2024

No worries! There's no rush.

@welpo
Copy link
Owner

welpo commented Jul 2, 2024

Hey @sam9032! I added the i18n update in #342.

If we can double check this PR is bug-free, I'll merge :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants