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