-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e4b0b03
commit 608d583
Showing
41 changed files
with
2,389 additions
and
1,876 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
queue_rules: | ||
- name: default | ||
conditions: | ||
- status-success=Vercel | ||
|
||
pull_request_rules: | ||
- name: Automatic merge of Snyk dependency upgrades (bot) | ||
conditions: | ||
- author=snyk-bot | ||
- -conflict | ||
- status-success=Vercel | ||
actions: | ||
queue: | ||
method: squash | ||
name: default | ||
- name: Automatic merge of Snyk dependency upgrades (me) | ||
conditions: | ||
- author=lwojcik | ||
- title~=[Snyk] | ||
- title~=Upgrade | ||
- -conflict | ||
- status-success=Vercel | ||
actions: | ||
queue: | ||
method: squash | ||
name: default | ||
- name: Automatic merge of Dependabot dependency upgrades | ||
conditions: | ||
- author=dependabot[bot] | ||
- -conflict | ||
- status-success=Vercel | ||
actions: | ||
queue: | ||
method: squash | ||
name: default | ||
- name: Ask to resolve conflict | ||
conditions: | ||
- conflict | ||
actions: | ||
comment: | ||
message: This pull request is now in conflicts. Could you fix it @{{author}}? | ||
- name: Automatic merge of owner-made PRs for main when CI passes and owner approves | ||
conditions: | ||
- status-success=Vercel | ||
- author=lwojcik | ||
- base=main | ||
- label!=work-in-progress | ||
- label=ready-to-merge | ||
actions: | ||
queue: | ||
method: squash | ||
name: default | ||
- name: Automatic merge of PRs for main when CI passes and owner approves | ||
conditions: | ||
- status-success=Vercel | ||
- base=main | ||
- label!=work-in-progress | ||
- approved-reviews-by=lwojcik | ||
- label=ready-to-merge | ||
actions: | ||
queue: | ||
method: squash | ||
name: default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const socialImages = require('./events/socialImages'); | ||
|
||
const afterBuildEvents = [socialImages]; | ||
|
||
module.exports = { | ||
after: afterBuildEvents, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const Image = require('@11ty/eleventy-img'); | ||
const siteConfig = require('../../content/_data/siteConfig'); | ||
|
||
const SOCIAL_PREVIEW_IMAGES_DIR = path.join('_site', 'images', 'share'); | ||
const OUTPUT_IMAGE_EXTENSION = 'jpg'; | ||
|
||
module.exports = () => { | ||
const files = fs.readdirSync(SOCIAL_PREVIEW_IMAGES_DIR); | ||
|
||
if (siteConfig.opengraph.enableImageGeneration) { | ||
if (files && files.length > 0) { | ||
files.forEach(async (filename) => { | ||
if (filename.endsWith('.svg')) { | ||
const imageUrl = path.join(SOCIAL_PREVIEW_IMAGES_DIR, filename); | ||
|
||
await Image(imageUrl, { | ||
formats: ['jpeg'], | ||
outputDir: path.join('.', SOCIAL_PREVIEW_IMAGES_DIR), | ||
filenameFormat: () => { | ||
const outputFilename = filename.substring(0, filename.length - 4); | ||
|
||
return `${outputFilename}.${OUTPUT_IMAGE_EXTENSION}`; | ||
}, | ||
}); | ||
|
||
// we no longer need SVG files after converting to JPG so we remove them | ||
|
||
// fs.unlinkSync(imageUrl); | ||
} | ||
}); | ||
} | ||
} else { | ||
// If OG image generation is off, SVG files are not needed, | ||
// so we remove them from the build | ||
fs.rmSync(SOCIAL_PREVIEW_IMAGES_DIR, { recursive: true, force: true }); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const moduleName = require('../helpers/moduleName'); | ||
|
||
const CHARACTERS_PER_LINE = 14; | ||
|
||
const body = (input) => { | ||
const parts = input.split(' '); | ||
|
||
const lines = parts.reduce((prev, current) => { | ||
if (!prev.length) { | ||
return [current]; | ||
} | ||
|
||
const lastOne = prev[prev.length - 1]; | ||
|
||
if (lastOne.length + current.length > CHARACTERS_PER_LINE) { | ||
return [...prev, current]; | ||
} | ||
|
||
prev[prev.length - 1] = lastOne + ' ' + current; | ||
|
||
return prev; | ||
}, []); | ||
|
||
return lines; | ||
}; | ||
|
||
module.exports = { | ||
name: moduleName(__filename), | ||
body, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.