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

docs: added docusaurus scheduler to awesome resources #9846

Closed
wants to merge 1 commit into from

Conversation

alvarolorentedev
Copy link

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.

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 14, 2024
Copy link

netlify bot commented Feb 14, 2024

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit c1d9319
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/65cd1a4442f3aa0008ab371c
😎 Deploy Preview https://deploy-preview-9846--docusaurus-2.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.

Copy link

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 70 🟢 98 🟢 96 🟢 100 🟠 88 Report
/docs/installation 🟠 88 🟢 96 🟢 100 🟢 100 🟠 88 Report
/docs/category/getting-started 🟠 74 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog 🟠 70 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 63 🟢 96 🟢 100 🟢 100 🟠 88 Report
/blog/tags/release 🟠 70 🟢 100 🟢 100 🟠 80 🟠 88 Report
/blog/tags 🟠 74 🟢 100 🟢 100 🟢 90 🟠 88 Report

Copy link
Collaborator

@slorber slorber left a 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- [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.

Copy link
Author

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.

Copy link
Collaborator

@slorber slorber Feb 15, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants