mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig.space.git
synced 2025-12-13 16:26:50 +00:00
Base URL environment variable
This commit is contained in:
@@ -3,8 +3,11 @@ const glob = require('glob')
|
||||
const { writeFileSync } = require('fs')
|
||||
const { resolve } = require('path')
|
||||
|
||||
const { DEPLOY_PRIME_URL, URL } = process.env
|
||||
const BASE = DEPLOY_PRIME_URL || URL || 'https://einundzwanzig.space'
|
||||
|
||||
const html = glob.sync(resolve(__dirname, '..', `dist/**/*.html`))
|
||||
const pages = html.map(file => file.replace(/.*\/dist/, 'https://einundzwanzig.space').replace(/index\.html$/, '')).filter(f => !f.endsWith('/kontakt/') && !f.endsWith('/datenschutz/'))
|
||||
const pages = html.map(file => file.replace(/.*\/dist/, BASE).replace(/index\.html$/, '')).filter(f => !f.endsWith('/kontakt/') && !f.endsWith('/datenschutz/'))
|
||||
const now = (new Date()).toISOString()
|
||||
const file = resolve(__dirname, '..', `src/sitemap.pug`)
|
||||
const rendered = pug.renderFile(file, { pages, now, pretty: true })
|
||||
|
||||
Reference in New Issue
Block a user