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

Add bin/banner script for random banner generation #165

Merged
merged 12 commits into from
Oct 18, 2023

Conversation

kenodegard
Copy link
Contributor

@kenodegard kenodegard commented Oct 13, 2023

Description

Instead of hunting around for free/permissive icons and generic/stock images to use for our blog posts lets just generate something random.

This is (shamelessly) inspired by GitHub's blog (https://github.blog/) where most of the banners are some abstract gradient with the GitHub logo.

This script relies on the https://github.com/qrohlf/trianglify library and is intended to be be invoked as:

$ npm run -- banner --output static/img/blog/.../banner.png

Warning
One of the dependencies (canvas) is not compiled for macOS-arm64, you'll need to follow these instructions: https://www.npmjs.com/package/canvas#compiling

This will generate images like the following:

Version 1

@kenodegard kenodegard self-assigned this Oct 13, 2023
@netlify
Copy link

netlify bot commented Oct 13, 2023

Deploy Preview for conda-dot-org ready!

Name Link
🔨 Latest commit 831e1e1
🔍 Latest deploy log https://app.netlify.com/sites/conda-dot-org/deploys/652f6571c7603600092bf8a5
😎 Deploy Preview https://deploy-preview-165--conda-dot-org.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.

@beeankha beeankha mentioned this pull request Oct 13, 2023
Comment on lines 27 to 28
width: 1200,
height: 630,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the "correct" size for a banner?

Copy link
Contributor

Choose a reason for hiding this comment

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

The exact size doesn't matter, but it should be close to a 2:1 aspect ratio

Comment on lines 19 to 23
} else if (props.index === 0) {
image = (
<CondaCSVG />
)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is why we get the big C if no image is defined in the frontMatter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opted to remove this, it looks cleaner IMO to display the image if present and to have no image otherwise

@kenodegard kenodegard changed the title Add backdrop script for random banner generation Add bin/banner script for random banner generation Oct 17, 2023
@kenodegard kenodegard force-pushed the random-banners branch 3 times, most recently from e3d4d91 to edbc303 Compare October 17, 2023 19:58
Copy link
Member

@beeankha beeankha 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 great, thank you so much @kenodegard !

Copy link
Contributor

@travishathaway travishathaway left a comment

Choose a reason for hiding this comment

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

@kenodegard,

The layout of the cards on the front page doesn't look quite right yet. The addition of the images for the other cards causes the big green card to be a lot taller and creates a lot of empty space.

Another problem with the layout of the smaller cards is the unequal height of the images. This makes everything look out of alignment.

@travishathaway travishathaway merged commit 02be2cd into conda:main Oct 18, 2023
4 checks passed
@kenodegard kenodegard deleted the random-banners branch October 18, 2023 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants