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 9 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 5c277cb
🔍 Latest deploy log https://app.netlify.com/sites/es-eslint/deploys/66fd614b48ddc400087773cb
😎 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 5c277cb
🔍 Latest deploy log https://app.netlify.com/sites/hi-eslint/deploys/66fd614bf6e0b0000818034a
😎 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 5c277cb
🔍 Latest deploy log https://app.netlify.com/sites/zh-hans-eslint/deploys/66fd614b0951ef0008983973
😎 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 5c277cb
🔍 Latest deploy log https://app.netlify.com/sites/ja-eslint/deploys/66fd614baeb8260008c3f087
😎 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 5c277cb
🔍 Latest deploy log https://app.netlify.com/sites/pt-br-eslint/deploys/66fd614b944c770008de51fb
😎 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 5c277cb
🔍 Latest deploy log https://app.netlify.com/sites/new-eslint/deploys/66fd614bfe8a2d000860abdc
😎 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 5c277cb
🔍 Latest deploy log https://app.netlify.com/sites/de-eslint/deploys/66fd614b8dd51b0009940b79
😎 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 5c277cb
🔍 Latest deploy log https://app.netlify.com/sites/fr-eslint/deploys/66fd614b5a9ad60008f7f39d
😎 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
src/_data/sponsors.md Outdated Show resolved Hide resolved
tools/generate-sponsors.js Outdated Show resolved Hide resolved
sponsors/sponsors.md Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@amareshsm
Copy link
Member Author

I will make the requested changes.

@nzakas
Copy link
Member

nzakas commented Sep 30, 2024

@amareshsm are you still working on this?

@amareshsm
Copy link
Member Author

@amareshsm are you still working on this?

Yes, I will push the request changes in some time.

<p>${sponsors
.map(
sponsor =>
`<a href="${sponsor.url || "#"}"><img src="${
Copy link
Member

Choose a reason for hiding this comment

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

There are sponsors for whom image might not exist as well. We might want to handle that? In the PR generated sponsors.md I was able to see one sponsor without image?
Screenshot 2024-10-01 at 11 39 20 PM

Copy link
Member Author

Choose a reason for hiding this comment

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

When I checked, I didn’t see a broken image icon. I will look it in this again.

image

Copy link
Member

Choose a reason for hiding this comment

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

The logo isn't missing on the website, and that's using the same data, so I'm not sure why this is creating a missing image. 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps you were using an old data file. Rebasing this branch and running the script again to regenerate sponsors.md might fix this.

Comment on lines 27 to 28
const SPONSORS_URL = path.resolve(__dirname, "../src/_data/sponsors.json");
const TECH_SPONSORS_URL = path.resolve(
Copy link
Member

Choose a reason for hiding this comment

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

Can we rename these to SPONSORS_FILE_PATH and TECH_SPONSORS_FILE_PATH as these are not URLs but file paths? Also, can we rename fetch* functions to read* as they're not fetching data from URLs but reading files?

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

@mdjermanovic
Copy link
Member

@nzakas in #638 (comment), did you mean that the generated file should be includes/sponsors.md?

@amareshsm
Copy link
Member Author

@nzakas in #638 (comment), did you mean that the generated file should be includes/sponsors.md?

Yes, it seems that the generated file should be placed inside the includes folder.

tools/generate-sponsors.js Outdated Show resolved Hide resolved
Co-authored-by: Nicholas C. Zakas <[email protected]>
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.

LGTM. Would like @mdjermanovic to review before merging.

Copy link
Member

@harish-sethuraman harish-sethuraman left a comment

Choose a reason for hiding this comment

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

LGTM. Once please run the script before committing. will leave it open for Milos.

@@ -9687,42 +9726,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/got": {
Copy link
Member

Choose a reason for hiding this comment

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

Any idea why this was removed? The only change in package.json dependencies was adding common-tags, which doesn't have any dependencies.

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