🛠 Meta information

This commit is contained in:
Dennis Reimann
2020-10-06 17:59:28 +02:00
parent d217db5ad8
commit 72226ddcf7
10 changed files with 70 additions and 25 deletions

View File

@@ -11,7 +11,10 @@ const assetPath = path => {
return `${(revs && revs[path]) || path}`
}
const assetUrl = (path, protocol = 'https') => {
return `${protocol}://einundzwanzig.space/${assetPath(path)}`
const base = path.startsWith('http') ? '' : `${protocol}://einundzwanzig.space`
let url = `${base}${assetPath(path)}`
if (!url.startsWith(`${protocol}:`)) url = url.replace(/^.*:/, `${protocol}:`)
return url
}
module.exports = {