The rest of the owl

This commit is contained in:
2026-02-28 12:13:24 -06:00
parent 54222db887
commit fdba0fdf8c
60 changed files with 1524 additions and 377 deletions

33
scripts/favicons.js Normal file
View File

@@ -0,0 +1,33 @@
import { favicons } from 'favicons'
import fs from 'fs'
const source = 'src/assets/logo/logo.png'
const cfg = {
path: 'assets/logo/favicon',
appName: 'Garrett Mills',
appDescription: '',
background: '#111111',
theme_color: '#111111',
}
// Generate the favicons and metadata:
const res = await favicons(source, cfg)
// Write out the favicon images:
for ( const img of res.images ) {
fs.writeFileSync(`src/assets/logo/favicon/${img.name}`, img.contents)
if ( img.name === 'favicon.ico' ) {
// Write the favicon to the root to support older browsers
fs.writeFileSync('src/favicon.ico', img.contents)
}
}
// Filter out the WebManifest & friends from the HTML, since we're not using it currently:
const fileNames = res.files.map(x => x.name)
const htmlLines = res.html.filter(line =>
fileNames.every(name => !line.includes(name)))
// Write the favicon metadata to a file to be picked up by Eleventy
fs.writeFileSync('src/_includes/meta.html', htmlLines.join('\n'))