Add canonical info

This commit is contained in:
Dennis Reimann
2024-05-20 20:44:24 +02:00
parent 744baaa781
commit ea3f8f4daf
2 changed files with 5 additions and 3 deletions

View File

@@ -31,10 +31,11 @@ const renderPage = (template, out, data = {}) => {
const needsRender = !changedFile || changedFile === templateFile || changedFile.startsWith('src/includes') || changedFile.endsWith('.js') || changedFile.endsWith('.json')
if (!needsRender) return
const file = resolve(__dirname, '..', templateFile)
const options = Object.assign({}, config, { site }, data)
const rendered = pug.renderFile(file, options)
const dest = out === 'index' ? 'index.html' : `${out}/index.html`
const pagePath = out === 'index' ? '/' : `/${out}/`
const file = resolve(__dirname, '..', templateFile)
const options = Object.assign({}, config, { site }, data, { pagePath })
const rendered = pug.renderFile(file, options)
const dst = resolve(__dirname, '..', 'dist', dest)
const dir = dirname(dst)