Skip to content

Commit bb337a2

Browse files
committed
track assets again
1 parent dc80532 commit bb337a2

File tree

256 files changed

+2951
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+2951
-0
lines changed

Diff for: assets/chrisspiegl.asc

+299
Large diffs are not rendered by default.

Diff for: assets/favicon/apple-touch-icon-114x114.png

4.18 KB

Diff for: assets/favicon/apple-touch-icon-120x120.png

4.36 KB

Diff for: assets/favicon/apple-touch-icon-144x144.png

5.55 KB

Diff for: assets/favicon/apple-touch-icon-152x152.png

6.08 KB

Diff for: assets/favicon/apple-touch-icon-57x57.png

1.85 KB

Diff for: assets/favicon/apple-touch-icon-60x60.png

1.94 KB

Diff for: assets/favicon/apple-touch-icon-72x72.png

2.42 KB

Diff for: assets/favicon/apple-touch-icon-76x76.png

2.62 KB

Diff for: assets/favicon/code.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<link rel="apple-touch-icon-precomposed" sizes="57x57" href="apple-touch-icon-57x57.png" />
2+
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114x114.png" />
3+
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72.png" />
4+
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="apple-touch-icon-144x144.png" />
5+
<link rel="apple-touch-icon-precomposed" sizes="60x60" href="apple-touch-icon-60x60.png" />
6+
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="apple-touch-icon-120x120.png" />
7+
<link rel="apple-touch-icon-precomposed" sizes="76x76" href="apple-touch-icon-76x76.png" />
8+
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="apple-touch-icon-152x152.png" />
9+
<link rel="icon" type="image/png" href="favicon-196x196.png" sizes="196x196" />
10+
<link rel="icon" type="image/png" href="favicon-96x96.png" sizes="96x96" />
11+
<link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32" />
12+
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16" />
13+
<link rel="icon" type="image/png" href="favicon-128.png" sizes="128x128" />
14+
<meta name="application-name" content="&nbsp;"/>
15+
<meta name="msapplication-TileColor" content="#FFFFFF" />
16+
<meta name="msapplication-TileImage" content="mstile-144x144.png" />
17+
<meta name="msapplication-square70x70logo" content="mstile-70x70.png" />
18+
<meta name="msapplication-square150x150logo" content="mstile-150x150.png" />
19+
<meta name="msapplication-wide310x150logo" content="mstile-310x150.png" />
20+
<meta name="msapplication-square310x310logo" content="mstile-310x310.png" />

Diff for: assets/favicon/favicon-128.png

4.68 KB

Diff for: assets/favicon/favicon-16x16.png

457 Bytes

Diff for: assets/favicon/favicon-196x196.png

8.46 KB

Diff for: assets/favicon/favicon-32x32.png

962 Bytes

Diff for: assets/favicon/favicon-96x96.png

3.45 KB

Diff for: assets/favicon/favicon.ico

33.7 KB
Binary file not shown.

Diff for: assets/favicon/mstile-144x144.png

5.55 KB

Diff for: assets/favicon/mstile-150x150.png

13 KB

Diff for: assets/favicon/mstile-310x150.png

28.7 KB

Diff for: assets/favicon/mstile-310x310.png

35.2 KB

Diff for: assets/favicon/mstile-70x70.png

4.68 KB

Diff for: assets/images.11ty.js

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
const path = require("path")
2+
const util = require("util")
3+
const glob = require("glob")
4+
const sharp = require("sharp")
5+
const mkdirp = require("mkdirp")
6+
7+
const outputPath = `_site/assets/images/`
8+
9+
const resizeConf = {
10+
sizes: [
11+
{
12+
width: 320,
13+
rename: { suffix: "-320w" },
14+
},
15+
{
16+
width: 640,
17+
rename: { suffix: "-640w" },
18+
},
19+
{
20+
width: 1280,
21+
rename: { suffix: "-1280w" },
22+
},
23+
{
24+
width: 1920,
25+
rename: { suffix: "-1920w" },
26+
},
27+
{
28+
width: 3840,
29+
rename: { suffix: "-3840w" },
30+
},
31+
],
32+
jpegOptions: {
33+
quality: 80,
34+
progressive: true,
35+
withMetadata: true,
36+
force: false,
37+
// errorOnUnusedImage: false,
38+
// errorOnEnlargement: false
39+
},
40+
webpOptions: {
41+
quality: 80,
42+
withMetadata: true,
43+
force: true,
44+
},
45+
pngOptions: {
46+
compressionLevel: 8,
47+
force: false,
48+
},
49+
}
50+
51+
module.exports = class {
52+
async data() {
53+
const filePath = path.join(__dirname, `/images/`)
54+
return {
55+
permalink: `/assets/images/images.json`,
56+
eleventyExcludeFromCollections: true,
57+
filePath,
58+
}
59+
}
60+
61+
async loadImages(imgFolder) {
62+
const cwd = path.resolve(imgFolder.file)
63+
const getImages = util.promisify(glob)
64+
const processedImages = []
65+
66+
const imgs = await getImages("**/*(*.jpg|*.png|*.gif)", { cwd: cwd })
67+
const imgsRendered = await getImages("**/*(*.jpg|*.png|*.gif)", { cwd: outputPath })
68+
69+
imgs.forEach(function (img) {
70+
const ext = path.extname(img)
71+
const base = path.basename(img, ext)
72+
const dir = path.dirname(img)
73+
74+
mkdirp.sync(path.join(outputPath, dir))
75+
76+
if (!imgsRendered.includes(img)) {
77+
// console.log(`PASS THROUGH MASTER FOR ${img}`)
78+
let passThroughImg = sharp(imgFolder.file + img)
79+
passThroughImg.toFile(path.join(outputPath, dir, base + ext))
80+
} else {
81+
// console.log(`FOUND MASTER FOR ${img}`)
82+
}
83+
84+
85+
const image = sharp(imgFolder.file + img)
86+
image
87+
.jpeg(resizeConf.jpegOptions)
88+
.png(resizeConf.pngOptions)
89+
.webp(resizeConf.webpOptions)
90+
resizeConf.sizes.forEach(function (size) {
91+
const newPath = path.join(dir, base + size.rename.suffix + ext)
92+
const newPathOutput = path.join(outputPath, newPath)
93+
if (imgsRendered.includes(newPath)) {
94+
// console.log(`FOUND RESIZED IMAGE FOR ${newPath}`)
95+
return
96+
}
97+
// console.log(`RENDERING NEW RESIZED IMAGE FOR ${newPath}`)
98+
const resized = image.resize({
99+
width: size.width,
100+
withoutEnlargement: true,
101+
kernel: "lanczos2",
102+
})
103+
resized.toFile(newPathOutput)
104+
})
105+
106+
processedImages.push(img)
107+
})
108+
109+
return JSON.stringify(processedImages, null, "\t")
110+
}
111+
112+
async render({ filePath }) {
113+
try {
114+
return await this.loadImages({ file: filePath })
115+
} catch (err) {
116+
throw new Error(err)
117+
}
118+
}
119+
}

Diff for: assets/images/gear/10-percent-happier.png

+3

Diff for: assets/images/gear/4-hour-work-week.png

+3

Diff for: assets/images/gear/4-hour-workweek.png

+3

Diff for: assets/images/gear/airbnb.png

+3

Diff for: assets/images/gear/anker-powercore-plus-26800.png

+3

Diff for: assets/images/gear/anker-usb-type-c-charging-hub.png

+3

Diff for: assets/images/gear/apple-airpods.png

+3

Diff for: assets/images/gear/apple-iphone-7-plus.png

+3

Diff for: assets/images/gear/apple-macbook-pro.png

+3

Diff for: assets/images/gear/apple-magic-keyboard.png

+3

Diff for: assets/images/gear/apple-magic-trackpad-2.png

+3

Diff for: assets/images/gear/aputure-mc.png

+3

Diff for: assets/images/gear/artlist.png

+3

Diff for: assets/images/gear/atem-mini.png

+3

Diff for: assets/images/gear/atomos-ninja-v.png

+3

Diff for: assets/images/gear/atr-2100.png

+3

Diff for: assets/images/gear/audiio.png

+3

Diff for: assets/images/gear/b-w-variable-nd.png

+3

Diff for: assets/images/gear/behringer-x-touch-mini.png

+3

Diff for: assets/images/gear/bose-qc-35.png

+3

Diff for: assets/images/gear/buffer.png

+3

0 commit comments

Comments
 (0)