mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig.space.git
synced 2025-12-14 00:36:48 +00:00
🎉 Initial setup
🎉 Initial setup
Setup deployment
This commit is contained in:
24
pug.config.js
Normal file
24
pug.config.js
Normal 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,
|
||||
}
|
||||
Reference in New Issue
Block a user