Skip to content

Commit c5192d9

Browse files
committed
url-spec: STATIC_VERSION 2a
1 parent 9c00d5b commit c5192d9

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/static/shared-util/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ Module imports under `src/static/js` may appear to be pointing to files that are
66

77
...is reading a file that doesn't exist here, under `shared-util`. This isn't an error!
88

9-
This folder (`src/shared-util`) does not actually exist in a build of the website; instead, the folder `src/util` is symlinked in its place. So, all files under `src/util` are actually available at `/shared-util/` online.
9+
This folder (`src/shared-util`) does not actually exist in a build of the website; instead, the folder `src/util` is symlinked in its place. So, all files under `src/util` are actually available at (e.g.) `/static/shared-util/` online.
1010

1111
The above import would actually import from the bindings in `src/util/sugar.js`.

src/url-spec.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import {withEntries} from '#sugar';
22

3+
// Static files are all grouped under a `static-${STATIC_VERSION}` folder as
4+
// part of a build. This is so that multiple builds of a wiki can coexist
5+
// served from the same server / file system root: older builds' HTML files
6+
// refer to earlier values of STATIC_VERSION, avoiding name collisions.
7+
const STATIC_VERSION = '2a';
8+
39
const genericPaths = {
410
root: '',
511
path: '<>',
@@ -67,25 +73,25 @@ const urlSpec = {
6773
},
6874

6975
staticCSS: {
70-
prefix: 'static/css/',
76+
prefix: `static-${STATIC_VERSION}/css/`,
7177
paths: genericPaths,
7278
},
7379

7480
staticJS: {
75-
prefix: 'static/js/',
81+
prefix: `static-${STATIC_VERSION}/js/`,
7682
paths: genericPaths,
7783
},
7884

7985
staticMisc: {
80-
prefix: 'static/misc/',
86+
prefix: `static-${STATIC_VERSION}/misc/`,
8187
paths: {
8288
...genericPaths,
8389
icon: 'icons.svg#icon-<>',
8490
},
8591
},
8692

8793
staticSharedUtil: {
88-
prefix: 'static/shared-util/',
94+
prefix: `static-${STATIC_VERSION}/shared-util/`,
8995
paths: genericPaths,
9096
},
9197

0 commit comments

Comments
 (0)