-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
feat: adds blog archive route #5428
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
Hi @gabrielcsapo! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-5428--docusaurus-2.netlify.app/ |
✔️ [V2] 🔨 Explore the source changes: 298b20b 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/6130ea99ebb7830008c0ae71 😎 Browse the preview: https://deploy-preview-5428--docusaurus-2.netlify.app |
CLA signed |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
cc @slorber |
Thanks @gabrielcsapo I cleaned up a bit your PR and added missing i18n support. Going to merge/release it now in beta.6 We can still improve this page in the future but at least an initial version is 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 think it's better to use reverse chronological order, and maybe just content as lists, including date of posts? Like on Bootstrap blog:
Oh sorry just saw your comment after merging 😅 wanted to merge it fast because I'm releasing beta.6 asap and it seemed good enough for a first version. Yes I actually found the years ordering a bit weird, and the design can be improved, please feel free to do so in another PR for the next release |
Don't worry, I'll try to find more examples of blog archives, and then probably improve current design. |
Agree with this. I'm so pleased this landed; I think it needs a little polish though. This is what it looks like on my own blog:
I read the PR a little closer and this can be configured with the
|
I just tried to use the
This is my section of presets: [
[
'@docusaurus/preset-classic',
({
docs: false,
blog: {
archive: {
title: 'Blog Archive',
description: 'Historic posts'
},
blogTitle: 'I CAN MAKE THIS WORK',
blogDescription: 'The blog of johnnyreilly',
/**
* Number of blog post elements to show in the blog sidebar
* 'ALL' to show all blog posts
* 0 to disable
*/
blogSidebarCount: 5,
postsPerPage: 1,
path: "./blog",
routeBasePath: "/", // Set this value to '/'.
showReadingTime: true,
editUrl:
"https://github.com/johnnyreilly/blog.johnnyreilly.com/edit/main/blog-website/blog/",
},
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
], It's possible I'm doing it wrong; but I am unable to work out how to do it right.... Moving the As well as the console error it doesn't seem to affect the content of the generated page either? I'm not sure if this is a bug or user error... |
Can it be configured though? The |
Maybe it can't be configured. If it can't it's probably something that would be desirable |
Definitely worth improving on. Also, if we add this in options, we will transfer the translation to |
You can use the i18n support tu customize all English labels, I don't think
it's worth it to add an option for each individual label
Le sam. 4 sept. 2021 à 15:18, Joshua Chen ***@***.***> a
écrit :
… Definitely worth improving on. Also, if we add this in options, we will
transfer the translation to plugin-blog instead, and we can start to
populate the options.json file😉
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#5428 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFW6PWY2XLZFF2LUWDWKGTUAITCXANCNFSM5C3YWNXQ>
.
|
In the same way we allow customizing the sidebar title and the blog title, we should allow customizing the archive title. For example, my site has a default |
We have a lot of text, aria labels etc in multiple places the theme and plugins. Adding all those to options would be quite overwhelming and create a large option api surface that would have breaking changes when we refactor UI. I feel it's more convenient and future proof to document better that the way to customize default english labels is by using At the same time the other files would feel "duplicate" (user does not want to translate the sidebar because it's already localized correctly). We should probably provide a way to override theme labels without using the |
Motivation
Fixes #4431
Special thanks to @johnnyreilly (https://blog.johnnyreilly.com/2021/05/01/blog-archive-for-docusaurus) for the inspiration and starting an issue to have this added.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Navigating to
http://localhost:3000/blog/archive
when serving the website via (cd website;yarn start;
) will yield the new blog archive page. Please see the attached screenshot the expected output.Related PRs
Docs have been updated in this PR to reflect the new option.