Molodetz blogrol volgens DPP-template
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// retoor <retoor@molodetz.nl>
|
||||
export class AssetUrl {
|
||||
static version() {
|
||||
const meta = document.querySelector('meta[name="asset-version"]');
|
||||
return meta ? meta.content : "";
|
||||
}
|
||||
|
||||
static resolve(path) {
|
||||
if (!path.startsWith("/static/") || path.startsWith("/static/uploads/")) {
|
||||
return path;
|
||||
}
|
||||
return `/static/v${AssetUrl.version()}/${path.slice("/static/".length)}`;
|
||||
}
|
||||
}
|
||||
|
||||
export const assetUrl = (path) => AssetUrl.resolve(path);
|
||||
Reference in New Issue
Block a user