jefklakscodex/jamstack-init.js

31 lines
927 B
JavaScript

const { howlongtobeat, webmention, youtube } = require('jam-my-stack');
const fsp = require('fs').promises;
(async function() {
// 1. get how long to beat times
console.log("1. adding Howlongtobeat info...")
await howlongtobeat.howlong(`${__dirname}/content/articles`)
// 2. get webmentions
console.log("2. Fetching webmentions...")
const mentions = await webmention.getWebmentions("jefklakscodex.com")
const json = JSON.stringify(mentions, null, 4)
await fsp.writeFile(`${__dirname}/data/webmentions.json`, json, 'utf-8')
// 3. send webmentions
console.log("3. Sending webmentions...")
await webmention.send("jefklakscodex.com")
// 4. generate youtube thumbnails.
console.log("4. Generating YouTube thumbnails...")
await youtube.thumbify({
postDir: `${__dirname}/content/articles`,
downloadDir: `${__dirname}/static/img/yt`,
overlayImg: `${__dirname}/play.png`
})
console.log("-- all done!")
})()