From ad31cc6eb67fe256e533e40cd50df3b1e53b542d Mon Sep 17 00:00:00 2001 From: wgroeneveld Date: Tue, 26 Apr 2022 13:47:07 +0200 Subject: [PATCH] get rid of workflow, use pre-commit hook instead --- jamstack-init.js | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 jamstack-init.js diff --git a/jamstack-init.js b/jamstack-init.js deleted file mode 100644 index 0ac5a42..0000000 --- a/jamstack-init.js +++ /dev/null @@ -1,41 +0,0 @@ - -const { howlongtobeat, webmention, youtube } = require('jam-my-stack'); -const fsp = require('fs').promises; - -if(!process.env.WEBMENTION_TOKEN) { - throw "No webmention token set!" -} - -const wmconfig = { - endpoint: 'https://jam.brainbaking.com', - token: process.env.WEBMENTION_TOKEN -}; - -(async function() { - // 1. get how long to beat times - console.log("1. adding Howlongtobeat info...") - await howlongtobeat.howlong({ - postDir: `${__dirname}/content`, - downloadDir: `${__dirname}/static/img/hltb` - }) - - // 2. get webmentions - console.log("2. Fetching webmentions...") - const mentions = await webmention.getWebmentions("jefklakscodex.com", wmconfig) - 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", wmconfig) - - // 4. generate youtube thumbnails. - console.log("4. Generating YouTube thumbnails...") - await youtube.thumbify({ - postDir: `${__dirname}/content`, - downloadDir: `${__dirname}/static/img/yt`, - overlayImg: `${__dirname}/play.png` - }) - - console.log("-- all done!") -})()