-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
docs: added docusaurus scheduler to awesome resources #9846
Conversation
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
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 your contribution.
To be honest I'm not super fan of merging this for a few reasons.
Notably the readme is not super clear on how it works, and as the Docusaurus maintainer I had to look at your source code to try to figure out how this seems to work, and I'm still not 100% sure. So a regular user would likely struggle to understand too.
Things such as the "published" front matter should rather be clearly explained otherwise people would have to retro-engineer your lib.
Similarly you use GHA workflow_dispatch, so it seems this process is kind-of manual?
More importantly, I don't think this is the right thing to do.
If you want to keep exclude some blog posts from the blog until a certain date, we have a better option for that: blogOptions.exclude
.
You could read the blog posts in your config file, and compute a blogOptions.exclude
dynamically option based on front matter fields
For this reason I'd prefer to close this PR for now and not add this resource, unless you prove me the blogOptions.exclude
is not a good solution.
@@ -66,6 +66,7 @@ See the <a href={require('@docusaurus/useBaseUrl').default('showcase')}>showcase | |||
- [docusaurus-plugin-typedoc](https://github.com/tgreyuk/typedoc-plugin-markdown/tree/master/packages/docusaurus-plugin-typedoc) - A Docusaurus plugin to build documentation with [TypeDoc](https://typedoc.org/) | |||
- [docusaurus-openapi-docs](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs) - A Docusaurus plugin and theme for generating interactive OpenAPI docs | |||
- [docusaurus-post-generator](https://github.com/moojing/docusaurus-post-generator) - A command line tool for user to add a blog/doc file quickly by command like `yarn gen-post new [template] [post_name]`. | |||
- [docusaurus-scheduler](https://github.com/alvarolorentedev/docusaurus-scheduler) - A docusarus compatible github action to schedule blog article releases based on a defined date in front-mater of md & mdx files. |
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.
- [docusaurus-scheduler](https://github.com/alvarolorentedev/docusaurus-scheduler) - A docusarus compatible github action to schedule blog article releases based on a defined date in front-mater of md & mdx files. | |
- [docusaurus-scheduler](https://github.com/alvarolorentedev/docusaurus-scheduler) - A Docusaurus compatible GitHub action to schedule blog article releases based on a defined date in front-mater of md & mdx files. |
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.
Sure don't merge it then 🙂.
What it does is simple it uses a temporal folder and moves them to the blog folder of docusaurus in the correct date.
Why I have not used exclude, it's because it requires manual work to take out of that list, you will need to do code changes manually and commit, that breaks any intention of automation. If i create an automation it needs to go to the docusarus config that could also be dynamic js
. is way more complex than it looks.
The real solution is this to be implemented at docusaurus level, only transpire the files after a date. That is why this is a community implementation and not official.
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.
The real solution is this to be implemented at docusaurus level
This PR enhances the existing blogOptions.sortPosts
feature with the ability to provide a function to do the sorting.
#9840
This will be a bit awkward but you could use this function to actually filter/modify the input blog posts instead of just sorting them 🤪 So technically this could be a better solution to this problem that exclude, considering you could filter based on blog post front matter directly.
We'll try to cleanup this API in the future and likely give it a better name, but for now it made more sense to "enhance" the already-existing sortPosts
option.
Motivation
Docusarus does not allow post scheduling, so this needs to be achieved through a file moving process that can be run in the integration pipelienes. I am adding that capability/extension made externally to the documentation of awesome external resources.