jefklakscodex/jamstack-init.js

22 lines
638 B
JavaScript

const { howlongtobeat, webmention } = require('jam-my-stack');
const fsp = require('fs').promises;
(async function() {
console.log("1. adding Howlongtobeat info...")
await howlongtobeat.howlong(`${__dirname}/content/articles`)
// 4. 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')
// 5. send webmentions
console.log("3. Sending webmentions...")
await webmention.send("jefklakscodex.com")
console.log("-- all done!")
})()