brainbaking/hooks/precommit.js

25 lines
705 B
JavaScript
Raw Normal View History

2023-05-08 10:45:48 +02:00
const { mastodon, webmention, youtube } = require('jam-my-stack');
const fsp = require('fs').promises;
const rootdir = `${__dirname}/../`;
(async function() {
2023-05-08 10:45:48 +02:00
// get webmentions (turned off, 08/05/2023)
/*
console.log("-- Fetching webmentions...")
const mentions = await webmention.getWebmentions("brainbaking.com", wmconfig)
2021-03-16 16:32:49 +01:00
const json = JSON.stringify(mentions, null, 4)
await fsp.writeFile(`${rootdir}/data/webmentions.json`, json, 'utf-8')
2023-05-08 10:45:48 +02:00
*/
2023-05-08 10:45:48 +02:00
console.log("--> Generating YouTube thumbnails...")
await youtube.thumbify({
postDir: `${rootdir}/content/post`,
downloadDir: `${rootdir}/static/img/yt`,
overlayImg: `${rootdir}/play.png`
})
2021-03-19 20:51:56 +01:00
2023-05-08 10:45:48 +02:00
console.log("-- precommit: all done!")
})()