-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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(blog): group sidebar items by year (themeConfig.blog.sidebar.groupByYear
)
#10252
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
thanks @alicelovescake Why not make it a first-class blog plugin option? I implemented a POC on your PR, let me know if this is what you had in mind: |
Love your code! It's exactly what we want and what I already implemented this on the Electron blog page. TBH, I wasn't sure whether you guys were open to the change so I just wanted to keep the PR as simple as possible. just added the css to mobile/desktop styles.module.css
Feel free to take over the PR with your changes and add a new config option. Let me know how I can help! |
Thanks for your feedback Yes I'll take it over and refactor a few things in the process
That's not super subtle IMHO, I'll try to find a good intermediate, but in any case you should be able to swizzle and customize for your own site if needed |
themeConfig.blog.sidebar.groupByYear
)
themeConfig.blog.sidebar.groupByYear
)themeConfig.blog.sidebar.groupByYear
)
themeConfig.blog.sidebar.groupByYear
)themeConfig.blog.sidebar.groupByYear
)
Ready to merge 🎉 |
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Thanks @slorber for making this happen! You made this PR so much better. Excited for this change! |
Motivation
This PR adds a new
themeConfig.blog.sidebar.groupByYear
option to group sidebar items by year in both mobile/desktop views.It is turned on by default to help feature discovery, because it makes sense for many sites to use it. Users that don't like it can opt-out with
themeConfig.blog.sidebar.groupByYear = false
Test Plan
Unit tests + dogfood
Test links
https://deploy-preview-10252--docusaurus-2.netlify.app/blog
Docs: https://deploy-preview-10252--docusaurus-2.netlify.app/docs/api/themes/configuration/#blog