Skip to content

Commit

Permalink
refactor(whatislove-dev): edit og image generation style wd-577 (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
what1s1ove authored Jun 13, 2024
1 parent 0dfdbf6 commit 57c692c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
20 changes: 8 additions & 12 deletions apps/whatislove-dev/eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,16 @@ let init = (config) => {
config.addPlugin(ogImage, {
outputDir: `images/covers`,
/**
* @returns {string}
* @this {{
* @param {{
* data: {
* page: {
* fileSlug: string
* }
* }
* }}
* }} ogImage
* @returns {string}
*/
outputFileSlug: function () {
return this.data.page.fileSlug
},
outputFileSlug: (ogImage) => ogImage.data.page.fileSlug,
satoriOptions: {
fonts: [400, 700].map((weight) => ({
data: readFileSync(
Expand All @@ -128,14 +126,12 @@ let init = (config) => {
})),
},
/**
* @returns {Promise<string>}
* @this {{
* @param {{
* outputUrl: () => Promise<string>
* }}
* }} ogImage
* @returns {Promise<string>}
*/
shortcodeOutput() {
return this.outputUrl()
},
shortcodeOutput: (ogImage) => ogImage.outputUrl(),
})

// filters
Expand Down
2 changes: 1 addition & 1 deletion apps/whatislove-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"bemlint": "1.7.0",
"browserslist": "4.22.1",
"dotenv": "16.4.5",
"eleventy-plugin-og-image": "4.0.0-beta.6",
"eleventy-plugin-og-image": "4.0.0-beta.7",
"esbuild": "0.19.5",
"html-minifier-terser": "7.2.0",
"json-server": "0.17.4",
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 57c692c

Please sign in to comment.