Skip to content

Commit dc318c6

Browse files
committed
content, url-spec: use static rather than shared, drop cachebust
1 parent 5c973b4 commit dc318c6

9 files changed

+11
-31
lines changed

src/content/dependencies/generatePageLayout.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export default {
1010
],
1111

1212
extraDependencies: [
13-
'cachebust',
1413
'getColors',
1514
'html',
1615
'language',
@@ -209,7 +208,6 @@ export default {
209208
},
210209

211210
generate(data, relations, slots, {
212-
cachebust,
213211
getColors,
214212
html,
215213
language,
@@ -598,7 +596,7 @@ export default {
598596

599597
html.tag('link', {
600598
rel: 'stylesheet',
601-
href: to('shared.staticFile', 'site.css', cachebust),
599+
href: to('static.path', 'site.css'),
602600
}),
603601

604602
html.tag('style', [
@@ -608,7 +606,7 @@ export default {
608606
]),
609607

610608
html.tag('script', {
611-
src: to('shared.staticFile', 'lazy-loading.js', cachebust),
609+
src: to('static.path', 'lazy-loading.js'),
612610
}),
613611
]),
614612

@@ -638,7 +636,7 @@ export default {
638636

639637
html.tag('script', {
640638
type: 'module',
641-
src: to('shared.staticFile', 'client.js', cachebust),
639+
src: to('static.path', 'client.js'),
642640
}),
643641
]),
644642
])

src/content/dependencies/image.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {empty} from '#sugar';
33

44
export default {
55
extraDependencies: [
6-
'cachebust',
76
'checkIfImagePathHasCachedThumbnails',
87
'getDimensionsOfImagePath',
98
'getSizeOfImagePath',
@@ -82,7 +81,6 @@ export default {
8281
},
8382

8483
generate(data, relations, slots, {
85-
cachebust,
8684
checkIfImagePathHasCachedThumbnails,
8785
getDimensionsOfImagePath,
8886
getSizeOfImagePath,
@@ -172,7 +170,7 @@ export default {
172170
if (willReveal) {
173171
reveal = [
174172
html.tag('img', {class: 'reveal-symbol'},
175-
{src: to('shared.staticFile', 'warning.svg', cachebust)}),
173+
{src: to('static.path', 'warning.svg')}),
176174

177175
html.tag('br'),
178176

src/content/dependencies/linkExternalAsIcon.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export default {
3737
html.tag('title', platformText),
3838

3939
html.tag('use', {
40-
href: to('shared.staticIcon', iconId),
40+
href: to('static.icon', iconId),
4141
}),
4242
]),
4343

src/upd8.js

-3
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ import * as buildModes from './write/build-modes/index.js';
9393

9494
const __dirname = path.dirname(fileURLToPath(import.meta.url));
9595

96-
const CACHEBUST = 23;
97-
9896
let COMMIT;
9997
try {
10098
COMMIT = execSync('git log --format="%h %B" -n 1 HEAD', {cwd: __dirname}).toString().trim();
@@ -2116,7 +2114,6 @@ async function main() {
21162114
webRoutes,
21172115
wikiData,
21182116

2119-
cachebust: '?' + CACHEBUST,
21202117
closeLanguageWatchers,
21212118
developersComment,
21222119
getSizeOfAdditionalFile,

src/url-spec.js

+6-12
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,7 @@ const urlSpec = {
6363
},
6464

6565
shared: {
66-
paths: {
67-
...genericPaths,
68-
69-
utilityRoot: 'util',
70-
staticRoot: 'static',
71-
72-
utilityFile: 'util/<>',
73-
staticFile: 'static/<>?<>',
74-
75-
staticIcon: 'static/icons.svg#icon-<>',
76-
},
66+
paths: genericPaths,
7767
},
7868

7969
media: {
@@ -102,7 +92,11 @@ const urlSpec = {
10292

10393
static: {
10494
prefix: 'static/',
105-
paths: genericPaths,
95+
paths: {
96+
...genericPaths,
97+
98+
icon: 'icons.svg#icon-<>',
99+
},
106100
},
107101

108102
util: {

src/write/bind-utilities.js

-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919

2020
export function bindUtilities({
2121
absoluteTo,
22-
cachebust,
2322
defaultLanguage,
2423
getSizeOfAdditionalFile,
2524
getSizeOfImagePath,
@@ -36,7 +35,6 @@ export function bindUtilities({
3635

3736
Object.assign(bound, {
3837
absoluteTo,
39-
cachebust,
4038
defaultLanguage,
4139
getSizeOfAdditionalFile,
4240
getSizeOfImagePath,

src/write/build-modes/live-dev-server.js

-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ export async function go({
103103
webRoutes,
104104
wikiData,
105105

106-
cachebust,
107106
developersComment: _developersComment,
108107
getSizeOfAdditionalFile,
109108
getSizeOfImagePath,
@@ -399,7 +398,6 @@ export async function go({
399398

400399
const bound = bindUtilities({
401400
absoluteTo,
402-
cachebust,
403401
defaultLanguage,
404402
getSizeOfAdditionalFile,
405403
getSizeOfImagePath,

src/write/build-modes/static-build.js

-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ export async function go({
115115
webRoutes,
116116
wikiData,
117117

118-
cachebust,
119118
developersComment: _developersComment,
120119
getSizeOfAdditionalFile,
121120
getSizeOfImagePath,
@@ -306,7 +305,6 @@ export async function go({
306305

307306
const bound = bindUtilities({
308307
absoluteTo,
309-
cachebust,
310308
defaultLanguage,
311309
getSizeOfAdditionalFile,
312310
getSizeOfImagePath,

test/lib/content-function.js

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ export function testContentFunctions(t, message, fn) {
5252
to,
5353
urls,
5454

55-
cachebust: 413,
5655
pagePath: ['home'],
5756
appendIndexHTML: false,
5857
getColors: c => getColors(c, {chroma}),

0 commit comments

Comments
 (0)