chore: only generate og images locally

This commit is contained in:
Cory Dransfeldt 2024-05-01 18:15:59 -07:00
parent 2cdded57a0
commit 362afdb588
No known key found for this signature in database
299 changed files with 31 additions and 23 deletions
.eleventy.js
config/events
package.json
src
_data
assets/img/social-preview
2021-reading-list-preview.jpeg2022-reading-list-preview.jpeg2023-in-review-preview.jpega-brief-intro-to-git-preview.jpega-cadillac-for-your-thoughts-2015-in-music-preview.jpega-music-workflow-for-2024-preview.jpega-retrospective-on-a-year-without-streaming-music-preview.jpega-safari-specific-guide-to-making-the-modern-web-suck-less-preview.jpega-vote-for-pai-is-a-vote-against-consumers-and-for-big-cable-preview.jpegaccess-to-data-isnt-a-grant-to-exploit-it-preview.jpegadding-a-light-dark-theme-toggle-preview.jpegadding-client-side-rendered-webmentions-to-my-blog-preview.jpegadding-client-side-webmentions-to-my-nextjs-blog-preview.jpegai-cannot-and-should-not-replace-search-preview.jpegajit-pai-accused-of-conflict-for-helping-former-client-preview.jpegajit-pai-follows-congress-instructions-requires-new-anti-robocall-tech-preview.jpegamericas-internet-freedom-rating-drops-following-net-neutrality-repeal-preview.jpegan-indie-web-primer-preview.jpeganother-eleventy-content-syndication-path-preview.jpegapple-centric-digital-privacy-tools-preview.jpegapple-messages-a-tale-of-woe-or-how-to-fix-sync-a-crash-loop-and-accept-data-loss-preview.jpegapple-music-a-tale-of-woe-preview.jpegarcade-fire-reflektor-preview.jpegaustralian-political-parties-hacked-preview.jpegautomate-and-syndicate-content-from-eleventy-to-mastodon-preview.jpegautomatic-feedbin-subscription-backups-preview.jpegautomatic-mastodon-post-embeds-preview.jpegautomating-and-probably-overengineering-my-now-page-preview.jpegautomating-email-cleanup-in-gmail-preview.jpegautomating-package-tracking-on-ios-preview.jpegautomating-rss-syndication-and-sharing-with-nextjs-and-github-preview.jpegavoiding-phishing-preview.jpegbackdoor-password-in-junipers-firewall-code-preview.jpegben-thompson-on-net-neutrality-preview.jpegbill-promises-californians-more-control-over-their-data-preview.jpegblitzen-trapper-ever-loved-once-preview.jpegblocking-spam-calls-from-similar-numbers-on-ios-preview.jpegbombino-and-hanni-el-khatib-at-the-santa-monica-pier-preview.jpegbrowsing-the-mobile-web-sucks-preview.jpegbuilding-a-bespoke-now-playing-web-component-preview.jpegbuilding-a-now-page-using-nextjs-and-social-apis-preview.jpegbuilding-a-popular-posts-widget-in-eleventy-using-plausible-analytics-preview.jpegbuilding-a-reactive-website-preview.jpegbuilding-a-scrobbler-using-plex-webhooks-edge-functions-and-blob-storage-preview.jpegbuilding-a-theme-toggle-web-component-preview.jpegbuilding-my-now-page-using-eleventy-preview.jpegca-governor-signs-nations-strictest-net-neutrality-law-preview.jpegca-net-neutrality-bill-back-on-track-preview.jpegca-net-neutrality-bill-makes-a-comeback-preview.jpegca-senate-passes-strict-net-neutrality-law-in-defiance-of-isps-preview.jpegcalifornia-approves-new-online-privacy-rules-preview.jpegcalifornia-passes-net-neutrality-bill-preview.jpegcalifornia-state-senate-passes-net-neutrality-legislation-preview.jpegcastro-v23-released-preview.jpegcbo-analysis-confirms-gop-health-bill-is-little-more-than-class-warfare-preview.jpegchanges-coming-to-droplr-preview.jpegcheck-if-images-are-available-before-optimizing-in-eleventy-preview.jpegcheck-in-to-your-personal-site-preview.jpegchrome-tool-helps-developers-make-websites-more-color-blind-friendly-preview.jpegclearing-mod_pagespeed-cache-preview.jpegcomcast-continues-to-whine-about-net-neutrality-preview.jpegcomcast-throttling-mobile-video-and-charging-extra-for-high-quality-streaming-preview.jpegcongress-guts-internet-privacy-protections-preview.jpegconsolidation-swiftly-follows-the-death-of-net-neutrality-preview.jpegcurrently-reading-preview.jpegdamien-jurado-2014-preview.jpegdata-collection-should-always-be-opt-in-preview.jpegdata-is-a-toxic-asset-preview.jpegdata-ownership-and-agency-preview.jpegdawes-most-people-preview.jpegdebugging-javascript-interview-with-mehdi-osman-preview.jpegdeploying-a-jekyll-site-to-netlify-with-docker-and-gitlab-ci-preview.jpegdesign-by-numbers-typography-preview.jpegdhs-boss-calls-for-more-fear-less-encryption-preview.jpegdigital-privacy-tools-preview.jpegdisplaying-listening-data-from-apple-music-using-musickitjs-preview.jpegdisplaying-now-playing-data-with-matching-emoji-using-netlify-edge-functions-and-eleventy-preview.jpegdoj-takes-war-on-encryption-to-whatsapp-preview.jpegdomain-names-as-discoverable-personal-identifiers-for-the-web-preview.jpegdont-be-afraid-to-admit-when-you-dont-know-something-preview.jpegdont-like-systematic-privacy-violations-stop-using-the-internet-preview.jpegdont-pin-your-political-hopes-on-tech-giants-preview.jpegdoppler-locally-stored-music-and-storage-as-a-beneficial-constraint-preview.jpegdressing-for-the-surveillance-age-preview.jpegdrying-up-now-page-templates-and-normalizing-data-in-eleventy-preview.jpegduckduckgo-is-good-enough-for-regular-use-preview.jpegdumb-pipes-preview.jpegdutch-government-on-encryption-preview.jpegearn-it-act-threatens-end-to-end-encryption-preview.jpegearn-it-is-an-attack-on-encryption-preview.jpegeff-argues-border-agents-need-warrants-to-search-digital-devices-preview.jpegeffs-recommendations-for-consumer-data-privacy-laws-preview.jpegembrace-extend-enshittify-preview.jpegending-net-neutrality-will-end-the-internet-as-we-know-it-preview.jpegenhancing-pagination-with-a-page-selector-preview.jpegenv-files-in-eleventy-preview.jpeg

View file

@ -48,6 +48,9 @@ export default async function (eleventyConfig) {
jsTruthy: true, jsTruthy: true,
}) })
// watch ignores
eleventyConfig.watchIgnores.add('src/assets/social-preview/**/*')
// passthrough // passthrough
eleventyConfig.addPassthroughCopy('src/assets') eleventyConfig.addPassthroughCopy('src/assets')
eleventyConfig.addPassthroughCopy('_redirects') eleventyConfig.addPassthroughCopy('_redirects')

View file

@ -3,26 +3,29 @@ import Image from '@11ty/eleventy-img'
import { minify } from 'terser' import { minify } from 'terser'
export const svgToJpeg = () => { export const svgToJpeg = () => {
const socialPreviewImagesDir = '_site/assets/img/social-preview/' if (process.env.ELEVENTY_RUN_MODE !== 'build') {
fs.readdir(socialPreviewImagesDir, (err, files) => { const socialPreviewImagesInputDir = '_site/assets/img/social-preview/'
if (!!files && files.length > 0) { const socialPreviewImagesOutputDir = 'src/assets/img/social-preview/'
files.forEach((fileName) => { fs.readdir(socialPreviewImagesInputDir, (err, files) => {
if (fileName.endsWith('.svg')) { if (!!files && files.length > 0) {
let imageUrl = socialPreviewImagesDir + fileName files.forEach((fileName) => {
Image(imageUrl, { if (fileName.endsWith('.svg')) {
formats: ['jpeg'], let imageUrl = socialPreviewImagesInputDir + fileName
outputDir: './' + socialPreviewImagesDir, Image(imageUrl, {
filenameFormat: function (id, src, width, format) { formats: ['jpeg'],
let outputFileName = fileName.substring(0, fileName.length - 4) outputDir: './' + socialPreviewImagesOutputDir,
return `${outputFileName}.${format}` filenameFormat: function (id, src, width, format) {
}, let outputFileName = fileName.substring(0, fileName.length - 4)
}) return `${outputFileName}.${format}`
} },
}) })
} else { }
console.log('⚠ No social images found') })
} } else {
}) console.log('⚠ No social images found')
}
})
}
} }
export const minifyJsComponents = async () => { export const minifyJsComponents = async () => {

View file

@ -1,6 +1,6 @@
{ {
"name": "coryd.dev", "name": "coryd.dev",
"version": "13.4.3", "version": "13.5.0",
"description": "The source for my personal site. Built using 11ty.", "description": "The source for my personal site. Built using 11ty.",
"type": "module", "type": "module",
"scripts": { "scripts": {

View file

@ -1,3 +1,5 @@
export default async function () { export default async function () {
return process.env.NODE_ENV return {
production: process.env.ELEVENTY_RUN_MODE === 'build'
}
} }

Binary file not shown.

After

(image error) Size: 13 KiB

Binary file not shown.

After

(image error) Size: 13 KiB

Binary file not shown.

After

(image error) Size: 12 KiB

Binary file not shown.

After

(image error) Size: 12 KiB

Binary file not shown.

After

(image error) Size: 21 KiB

Binary file not shown.

After

(image error) Size: 14 KiB

Binary file not shown.

After

(image error) Size: 22 KiB

Binary file not shown.

After

(image error) Size: 19 KiB

Binary file not shown.

After

(image error) Size: 18 KiB

Binary file not shown.

After

(image error) Size: 24 KiB

Binary file not shown.

After

(image error) Size: 23 KiB

Binary file not shown.

After

(image error) Size: 19 KiB

Binary file not shown.

After

(image error) Size: 13 KiB

Binary file not shown.

After

(image error) Size: 20 KiB

Binary file not shown.

After

(image error) Size: 18 KiB

Binary file not shown.

After

(image error) Size: 15 KiB

Binary file not shown.

After

(image error) Size: 15 KiB

Binary file not shown.

After

(image error) Size: 19 KiB

Binary file not shown.

After

(image error) Size: 21 KiB

Binary file not shown.

After

(image error) Size: 18 KiB

Binary file not shown.

After

(image error) Size: 17 KiB

Binary file not shown.

After

(image error) Size: 19 KiB

Binary file not shown.

After

(image error) Size: 13 KiB

Binary file not shown.

After

(image error) Size: 22 KiB

Binary file not shown.

After

(image error) Size: 16 KiB

Binary file not shown.

After

(image error) Size: 17 KiB

Binary file not shown.

After

(image error) Size: 21 KiB

Binary file not shown.

After

(image error) Size: 17 KiB

Binary file not shown.

After

(image error) Size: 22 KiB

Binary file not shown.

After

(image error) Size: 23 KiB

Binary file not shown.

After

(image error) Size: 16 KiB

Binary file not shown.

After

(image error) Size: 20 KiB

Binary file not shown.

After

(image error) Size: 18 KiB

Binary file not shown.

After

(image error) Size: 18 KiB

Binary file not shown.

After

(image error) Size: 19 KiB

Binary file not shown.

After

(image error) Size: 21 KiB

Binary file not shown.

After

(image error) Size: 20 KiB

Binary file not shown.

After

(image error) Size: 14 KiB

Binary file not shown.

After

(image error) Size: 15 KiB

Binary file not shown.

After

(image error) Size: 17 KiB

Binary file not shown.

After

(image error) Size: 17 KiB

Binary file not shown.

After

(image error) Size: 22 KiB

Binary file not shown.

After

(image error) Size: 21 KiB

Binary file not shown.

After

(image error) Size: 13 KiB

Binary file not shown.

After

(image error) Size: 13 KiB

Binary file not shown.

After

(image error) Size: 19 KiB

Binary file not shown.

After

(image error) Size: 14 KiB

Binary file not shown.

After

(image error) Size: 15 KiB

Binary file not shown.

After

(image error) Size: 13 KiB

Binary file not shown.

After

(image error) Size: 23 KiB

Binary file not shown.

After

(image error) Size: 17 KiB

Binary file not shown.

After

(image error) Size: 20 KiB

Binary file not shown.

After

(image error) Size: 14 KiB

Binary file not shown.

After

(image error) Size: 20 KiB

Binary file not shown.

After

(image error) Size: 20 KiB

Binary file not shown.

After

(image error) Size: 18 KiB

Binary file not shown.

After

(image error) Size: 20 KiB

Binary file not shown.

After

(image error) Size: 11 KiB

Binary file not shown.

After

(image error) Size: 17 KiB

Binary file not shown.

After

(image error) Size: 21 KiB

Binary file not shown.

After

(image error) Size: 17 KiB

Binary file not shown.

After

(image error) Size: 16 KiB

Binary file not shown.

After

(image error) Size: 20 KiB

Binary file not shown.

After

(image error) Size: 13 KiB

Some files were not shown because too many files have changed in this diff Show more