-
-
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): add feed XSLT options to render beautiful RSS and Atom feeds #9252
Conversation
Hi @Xebec19! 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 cla@meta.com. Thanks! |
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site configuration. |
⚡️ Lighthouse report for the deploy preview of this PR
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
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
That looks like a good start but is not enough to be merged for a few reasons.
In case it wasn't clear: the goal is not to add XSLT just for our own website, but to build it as a feature for any Docusaurus site to have by default.
It needs to be modular and it needs to work well out of the box on any Docusaurus site, without conflicting with existing user static assets. My suggestion would be to output the xslt/css next to the feeds, under /blog/
for example, so that it is namespaced and we can use 2 blogs with different CSS/XSLT files.
The Atom feed is broken, see:
- Before https://docusaurus.io/blog/atom.xml
- After: https://deploy-preview-9252--docusaurus-2.netlify.app/blog/atom.xml
Also I don't think it looks super great as is. My suggestion would be to steal/adapt XSLT/CSS from what https://darekkay.com/blog/rss-styling/ is using. We'll improve from there.
OK I will do the requested changes |
packages/docusaurus-plugin-content-blog/src/plugin-content-blog.d.ts
Outdated
Show resolved
Hide resolved
During the refactor of my review I've thought about the customization. Original files are in the plugin content blog (I don't think its the right place though it works)
|
Motivation
Adding XSLT / CSS support for the blog feeds permits to style them instead of printing XML markup:
This PR adds a new
feedOptions.xslt
attribute that permits to:true
} default XSLT/CSS styling using our built-in.xsl
/.css
files
.xsl
/.css
files for custom stylingTest Plan
CI / unit test / argos / dogfood
Test links
Before:
After (Default xslt):
After (Custom xslt)
Related issues/PRs
Fix #9197
Related links
Feature inspired by these resources:
Examples of other styled RSS feeds: