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: Prerender sponsors for READMEs #638

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

Conversation

amareshsm
Copy link
Member

Prerequisites checklist

What is the purpose of this pull request?

Prerender sponsors for READMEs

What changes did you make? (Give an overview)

I added a script that retrieves sponsor data from JSON files and formats it into HTML sections for a markdown file. This script categorizes sponsors by tier and incorporates technology sponsors with their respective images. It then saves the formatted content to a new markdown file, sponsors.md, which we will utilize in our other repositories.

Related Issues

#619

Is there anything you'd like reviewers to focus on?

Please let me know if this approach works and I'm open to any suggestions/changes.

Copy link

netlify bot commented Sep 23, 2024

Deploy Preview for es-eslint ready!

Name Link
🔨 Latest commit 2fa4d22
🔍 Latest deploy log https://app.netlify.com/sites/es-eslint/deploys/66f1b3df0b2bfb000870b60c
😎 Deploy Preview https://deploy-preview-638--es-eslint.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

netlify bot commented Sep 23, 2024

Deploy Preview for hi-eslint ready!

Name Link
🔨 Latest commit 2fa4d22
🔍 Latest deploy log https://app.netlify.com/sites/hi-eslint/deploys/66f1b3df9ed4e0000831c8a7
😎 Deploy Preview https://deploy-preview-638--hi-eslint.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

netlify bot commented Sep 23, 2024

Deploy Preview for zh-hans-eslint ready!

Name Link
🔨 Latest commit 2fa4d22
🔍 Latest deploy log https://app.netlify.com/sites/zh-hans-eslint/deploys/66f1b3df49fb2e000991da93
😎 Deploy Preview https://deploy-preview-638--zh-hans-eslint.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

netlify bot commented Sep 23, 2024

Deploy Preview for ja-eslint ready!

Name Link
🔨 Latest commit 2fa4d22
🔍 Latest deploy log https://app.netlify.com/sites/ja-eslint/deploys/66f1b3df14ff4d0008d9bd1d
😎 Deploy Preview https://deploy-preview-638--ja-eslint.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

netlify bot commented Sep 23, 2024

Deploy Preview for pt-br-eslint ready!

Name Link
🔨 Latest commit 2fa4d22
🔍 Latest deploy log https://app.netlify.com/sites/pt-br-eslint/deploys/66f1b3df0d5aee0008415bdf
😎 Deploy Preview https://deploy-preview-638--pt-br-eslint.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

netlify bot commented Sep 23, 2024

Deploy Preview for new-eslint ready!

Name Link
🔨 Latest commit 2fa4d22
🔍 Latest deploy log https://app.netlify.com/sites/new-eslint/deploys/66f1b3dfc6c5c900089d662f
😎 Deploy Preview https://deploy-preview-638--new-eslint.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

netlify bot commented Sep 23, 2024

Deploy Preview for de-eslint ready!

Name Link
🔨 Latest commit 2fa4d22
🔍 Latest deploy log https://app.netlify.com/sites/de-eslint/deploys/66f1b3df6e87f200081902a0
😎 Deploy Preview https://deploy-preview-638--de-eslint.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

netlify bot commented Sep 23, 2024

Deploy Preview for fr-eslint ready!

Name Link
🔨 Latest commit 2fa4d22
🔍 Latest deploy log https://app.netlify.com/sites/fr-eslint/deploys/66f1b3df9844500008007c91
😎 Deploy Preview https://deploy-preview-638--fr-eslint.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
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

This is a good start. We also need to make sure that this script is run whenever the website is built.

src/_data/sponsors.md Outdated Show resolved Hide resolved
<p><a href="https://www.crosswordsolver.org/anagram-solver/"><img src="https://images.opencollective.com/anagram-solver/2666271/logo.png" alt="Anagram Solver" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://nx.dev"><img src="https://avatars.githubusercontent.com/u/23692104?v=4" alt="Nx" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774?v=4" alt="HeroCoders" height="32"></a> <a href="https://usenextbase.com"><img src="https://avatars.githubusercontent.com/u/145838380?v=4" alt="Nextbase Starter Kit" height="32"></a></p>
<!--sponsorsend-->
<!--techsponsorsstart-->
<h2>Technology Sponsors</h2>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<h2>Technology Sponsors</h2>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.

Copy link
Member

Choose a reason for hiding this comment

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

rather than running this on build I'd suggest we run this as part of the workflow as we do now? This in turn commits sponsors data to the repo and triggers build automatically? 🤔

- name: Fetch sponsor data
run: npm run fetch:sponsors
env:
ESLINT_GITHUB_TOKEN: ${{ secrets.DATA_FETCH_TOKEN }}

Copy link
Member

@harish-sethuraman harish-sethuraman Sep 23, 2024

Choose a reason for hiding this comment

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

ah nvm it would run inside the build script as well 👍🏻. The doubt I had was is this related to build of the site? This is more related to data fetch scripts so I felt it would be better to chunk out of build related process.

Copy link
Member

@mdjermanovic mdjermanovic Sep 24, 2024

Choose a reason for hiding this comment

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

Yes, this isn't related to the site build. We need the new file to be committed and pushed to GitHub, so this should be run as part of the data-fetch workflow.

Copy link
Member

Choose a reason for hiding this comment

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

We'll also need to update this to include the new file:

# commit the result
git add src/_data/
git commit -m "chore: Update remote data"

@@ -26,20 +26,25 @@ const got = require("got");

const SPONSORS_URL =
"https://raw.githubusercontent.com/eslint/eslint.org/main/src/_data/sponsors.json";
const NEW_FILE_PATH = "../src/_data/sponsors.md";
const NEW_FILE_PATH = "./sponsors.md";
Copy link
Member

Choose a reason for hiding this comment

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

Let's create a new folder for this, it doesn't belong in the tools directory. Maybe includes?

Comment on lines +28 to +32
const SPONSORS_URL =
"https://raw.githubusercontent.com/eslint/eslint.org/main/src/_data/sponsors.json";
const NEW_FILE_PATH = path.resolve(__dirname, "../sponsors/sponsors.md");
const TECH_SPONSORS_URL =
"https://raw.githubusercontent.com/eslint/eslint.org/main/src/_data/techsponsors.json";
Copy link
Member

Choose a reason for hiding this comment

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

src/_data/sponsors.json and src/_data/techsponsors.json are local files here, there's no need to fetch them.


The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
<!--sponsorsstart-->
Copy link
Member

Choose a reason for hiding this comment

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

We can remove these comments because we're regenerating the entire file each time.

@@ -14,13 +14,14 @@
},
"license": "Apache-2.0",
"scripts": {
"build": "npm-run-all install:playground build:sass build:website build:playground build:minify-images",
"build": "npm-run-all install:playground build:sass build:website build:playground build:minify-images build:sponsors",
Copy link
Member

Choose a reason for hiding this comment

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

This isn't actually part of the site, so I don't think it should be included in this command.

Copy link
Member Author

Choose a reason for hiding this comment

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

sure

@amareshsm
Copy link
Member Author

I will make the requested changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Implementing
Development

Successfully merging this pull request may close these issues.

4 participants