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

feat(rss feed): added xslt for rss feed #9252

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

Xebec19
Copy link

@Xebec19 Xebec19 commented Aug 23, 2023

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

I have added an XSLT file for the RSS feed as was required in issue #9197

User can enable this feature by adding below property in feedOptions

xsl: {
                enable: true,
                rssStylesheet: 'custom-rss.stylesheet.xslt',
                atomStylesheet: 'custom-atom.stylesheet.xslt'
}

User need to save her custom stylesheets in static folder. If they do not give a custom stylesheet, default stylesheets would be used

Test Plan

I have added two snapshots to test default and custom stylesheets

Test links

Deploy preview: https://deploy-preview-9252--docusaurus-2.netlify.app/

Before:

After (Default xslt):

After (Custom xslt)

Related issues/PRs

fix #9197

Screenshot from 2023-09-03 13-47-18
Screenshot from 2023-09-03 13-47-22

@facebook-github-bot
Copy link
Contributor

Hi @Xebec19!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@netlify
Copy link

netlify bot commented Aug 23, 2023

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 3b02024
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/64f43f4517bf1f000711940b
😎 Deploy Preview https://deploy-preview-9252--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.

@github-actions
Copy link

github-actions bot commented Aug 23, 2023

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 58 🟢 97 🟢 92 🟢 100 🟠 89 Report
/docs/installation 🟠 75 🟢 98 🟢 92 🟢 100 🟠 89 Report

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Aug 23, 2023
@slorber slorber added Argos Add this label to run UI visual regression tests. See argos.yml GH action. pr: new feature This PR adds a new API or behavior. labels Aug 24, 2023
@argos-ci
Copy link

argos-ci bot commented Aug 24, 2023

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 🧿 Changes detected (Review) 2 changes Sep 19, 2023, 1:39 PM

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

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:

CleanShot 2023-08-24 at 17 11 51@2x

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.

packages/docusaurus-plugin-content-blog/src/feed.ts Outdated Show resolved Hide resolved
website/static/rss.xslt Outdated Show resolved Hide resolved
website/static/styles.css Outdated Show resolved Hide resolved
@slorber slorber marked this pull request as draft August 24, 2023 15:11
@Xebec19
Copy link
Author

Xebec19 commented Aug 24, 2023

OK I will do the requested changes

@Xebec19 Xebec19 requested a review from slorber September 3, 2023 08:12
@Xebec19 Xebec19 marked this pull request as ready for review September 8, 2023 03:44
@slorber slorber added the apprentice Issues that are good candidates to be handled by a Docusaurus apprentice / trainee label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apprentice Issues that are good candidates to be handled by a Docusaurus apprentice / trainee Argos Add this label to run UI visual regression tests. See argos.yml GH action. CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blog feeds render nicely by default (XSLT stylesheet)
3 participants