Created
April 9, 2020 23:41
-
-
Save incanus/5d538f00db298c33d821611cdd00df30 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const moment = require('moment'); | |
const raw = require('config/raw').raw; | |
const generatePostFilename = (timestamp, slug) => { | |
const postDate = moment(timestamp).format('YYYY-MM-DD'); | |
return `content/microposts/${postDate}-${slug}/index.md`; | |
}; | |
const generatePostUrl = (timestamp, slug) => { | |
const postDate = moment(timestamp).format('YYYY/MM/DD'); | |
return `https://a847fd4b660e3b181778f3bf9efdd7cb.balena-devices.com/microposts/${postDate}/${slug}/`; | |
}; | |
const generateMediaFilenamePrefix = (timestamp, slug) => { | |
const filename = generatePostFilename(timestamp, slug); | |
return `${filename.replace(/index\.md$/, '')}`; | |
}; | |
const generateMediaFilenameSuffix = () => { | |
return ':filesslug'; | |
}; | |
module.exports = { | |
app: { | |
listenPort: 80, | |
microblogPingFeedURL: '', | |
publishCommand: '/app/publish.sh', | |
}, | |
site: { | |
indieauth: { | |
identity: 'https://justinmiller.io', | |
tokenEndpoint: 'https://tokens.indieauth.com/token', | |
}, | |
root: '/app/repo', | |
}, | |
posts: { | |
generators: { | |
url: raw(generatePostUrl), | |
filename: raw(generatePostFilename), | |
}, | |
layoutName: '', | |
tags: { | |
key: 'tags', | |
style: 'yaml_list', | |
}, | |
}, | |
media: { | |
generators: { | |
filenamePrefix: raw(generateMediaFilenamePrefix), | |
filenameSuffix: raw(generateMediaFilenameSuffix), | |
}, | |
}, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment