Files
devplacepy/devplacepy/static/js/assetVersion.js
T
retoor 1b89f7c49f feat: add seo diagnostics tool with cli commands, config paths, and static versioning
Add SEO_REPORTS_DIR to config, STATIC_VERSION for cache-busting, seo prune/clear CLI subcommands, tools router with seo job endpoints, and boot-versioned static URLs in Dockerfile and Makefile
2026-06-14 00:16:22 +00:00

12 lines
360 B
JavaScript

// retoor <retoor@molodetz.nl>
const META = document.querySelector('meta[name="asset-version"]');
const VERSION = META ? META.content : "";
export function assetUrl(path) {
if (!VERSION || !path.startsWith("/static/") || path.startsWith("/static/uploads/")) {
return path;
}
return `/static/v${VERSION}${path.slice("/static".length)}`;
}