// 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)}`;
}
