🎉 Initial setup

🎉 Initial setup

Setup deployment
This commit is contained in:
Dennis Reimann
2020-10-03 21:49:25 +02:00
commit 0202e858e6
55 changed files with 11718 additions and 0 deletions

24
pug.config.js Normal file
View File

@@ -0,0 +1,24 @@
// initialize markdown rendering
const renderMarkdown = require('./markdown')
const slugify = str => str.toLowerCase().replace(/\W/, '-')
const random = max => Math.floor(Math.random() * Math.floor(max))
const linkTarget = url => url.startsWith('http') ? '_blank' : null
const assetPath = path => {
let revs
try { revs = require('./rev-manifest.json') } catch (error) { }
return `${(revs && revs[path]) || path}`
}
const assetUrl = (path, protocol = 'https') => {
return `${protocol}://einundzwanzig.space/${assetPath(path)}`
}
module.exports = {
basedir: './src/includes',
random,
slugify,
assetUrl,
assetPath,
linkTarget,
renderMarkdown,
}