bye bye webmentions...
This commit is contained in:
parent
6bfd067a78
commit
02174c564c
|
@ -1,19 +1,5 @@
|
||||||
|
|
||||||
const { webmention } = require('jam-my-stack');
|
|
||||||
|
|
||||||
if(!process.env.WEBMENTION_TOKEN) {
|
|
||||||
throw "No webmention token set!"
|
|
||||||
}
|
|
||||||
|
|
||||||
const wmconfig = {
|
|
||||||
endpoint: 'https://jam.brainbaking.com',
|
|
||||||
token: process.env.WEBMENTION_TOKEN
|
|
||||||
};
|
|
||||||
|
|
||||||
(async function() {
|
(async function() {
|
||||||
// 1. send webmentions
|
console.log("-- postdeploy: all done!")
|
||||||
console.log("1. Sending webmentions...")
|
|
||||||
await webmention.send("jefklakscodex.com", wmconfig)
|
|
||||||
|
|
||||||
console.log("-- all done!")
|
|
||||||
})()
|
})()
|
||||||
|
|
|
@ -1,41 +1,25 @@
|
||||||
|
|
||||||
const fsp = require('fs').promises;
|
const fsp = require('fs').promises;
|
||||||
const { resolve } = require('path');
|
const { resolve } = require('path');
|
||||||
const { howlongtobeat, webmention, youtube } = require('jam-my-stack');
|
const { howlongtobeat, youtube } = require('jam-my-stack');
|
||||||
|
|
||||||
if(!process.env.WEBMENTION_TOKEN) {
|
|
||||||
throw "No webmention token set!"
|
|
||||||
}
|
|
||||||
|
|
||||||
const wmconfig = {
|
|
||||||
endpoint: 'https://jam.brainbaking.com',
|
|
||||||
token: process.env.WEBMENTION_TOKEN
|
|
||||||
};
|
|
||||||
|
|
||||||
// If this isn't resolved, jam-my-stack will fail to replace 'content' with 'static' when downloading covers.
|
// If this isn't resolved, jam-my-stack will fail to replace 'content' with 'static' when downloading covers.
|
||||||
const rootdir = resolve(`${__dirname}/..`);
|
const rootdir = resolve(`${__dirname}/..`);
|
||||||
|
|
||||||
(async function() {
|
(async function() {
|
||||||
// 1. get how long to beat times
|
console.log("--> adding Howlongtobeat info...")
|
||||||
console.log("1. adding Howlongtobeat info...")
|
|
||||||
await howlongtobeat.howlong({
|
await howlongtobeat.howlong({
|
||||||
postDir: `${rootdir}/content`,
|
postDir: `${rootdir}/content`,
|
||||||
downloadDir: `${rootdir}/static`
|
downloadDir: `${rootdir}/static`
|
||||||
})
|
})
|
||||||
|
|
||||||
// 2. get webmentions
|
console.log("--> Generating YouTube thumbnails...")
|
||||||
console.log("2. Fetching webmentions...")
|
|
||||||
const mentions = await webmention.getWebmentions("jefklakscodex.com", wmconfig)
|
|
||||||
const json = JSON.stringify(mentions, null, 4)
|
|
||||||
await fsp.writeFile(`${rootdir}/data/webmentions.json`, json, 'utf-8')
|
|
||||||
|
|
||||||
// 3. generate youtube thumbnails.
|
|
||||||
console.log("4. Generating YouTube thumbnails...")
|
|
||||||
await youtube.thumbify({
|
await youtube.thumbify({
|
||||||
postDir: `${rootdir}/content`,
|
postDir: `${rootdir}/content`,
|
||||||
downloadDir: `${rootdir}/static/img/yt`,
|
downloadDir: `${rootdir}/static/img/yt`,
|
||||||
overlayImg: `${rootdir}/play.png`
|
overlayImg: `${rootdir}/play.png`
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log("-- all done!")
|
console.log("-- precommit: all done!")
|
||||||
})()
|
})()
|
||||||
|
|
|
@ -59,7 +59,6 @@
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
{{ partial "single-comments" . }}
|
{{ partial "single-comments" . }}
|
||||||
{{ partial "single-mentions" . }}
|
|
||||||
<hr/>
|
<hr/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
<link rel="me" title="Mastodon" href="{{ .Site.Author.mastodonlink }}" />
|
<link rel="me" title="Mastodon" href="{{ .Site.Author.mastodonlink }}" />
|
||||||
<link rel="me" title="Github" href="{{ .Site.Author.githublink }}" />
|
<link rel="me" title="Github" href="{{ .Site.Author.githublink }}" />
|
||||||
<link rel="author" href="{{ $base }}humans.txt" type="text/plain" />
|
<link rel="author" href="{{ $base }}humans.txt" type="text/plain" />
|
||||||
<link rel="webmention" href="https://jam.brainbaking.com/webmention" />
|
|
||||||
<link rel="pingback" href="https://jam.brainbaking.com/pingback" />
|
|
||||||
{{- if .Description }}
|
{{- if .Description }}
|
||||||
<meta name="description" content="{{ .Title }}. {{ .Description | safeHTML }} Via {{ .Site.Title }}">
|
<meta name="description" content="{{ .Title }}. {{ .Description | safeHTML }} Via {{ .Site.Title }}">
|
||||||
<meta content="{{ .Title }}. {{ .Description | safeHTML }} Via {{ .Site.Title }}" property="og:description">
|
<meta content="{{ .Title }}. {{ .Description | safeHTML }} Via {{ .Site.Title }}" property="og:description">
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
{{ if (not .Params.disableComments) }}
|
|
||||||
{{ $mentions := (where .Site.Data.webmentions "relativeTarget" "==" $.RelPermalink) }}
|
|
||||||
|
|
||||||
{{ if $mentions }}
|
|
||||||
<hr/>
|
|
||||||
<h3 class="page-header" id="mentions">
|
|
||||||
<a href="#mentions">
|
|
||||||
<svg class='icon icon-text' width='24' height='24'>
|
|
||||||
<title>Discussion</title>
|
|
||||||
<use xlink:href='#discuss'></use>
|
|
||||||
</svg>
|
|
||||||
</a>
|
|
||||||
Mentions and Replies
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div class="tootlist" style="margin-bottom: -3rem">
|
|
||||||
{{ range $mentions }}
|
|
||||||
<article class="u-comment h-cite toot">
|
|
||||||
<small>
|
|
||||||
<p class="p-content p-name">
|
|
||||||
{{ .name | safeHTML }}: {{ .content | safeHTML }}
|
|
||||||
</p>
|
|
||||||
<div class="meta">
|
|
||||||
<svg class='icon icon-inline'>
|
|
||||||
<use xlink:href='#cal1'></use>
|
|
||||||
</svg>
|
|
||||||
<time class="dt-published" datetime="{{ .published }}">
|
|
||||||
{{- $publishedAsDate := .published | time -}}
|
|
||||||
{{ partial "reldate" $publishedAsDate }}
|
|
||||||
</time>
|
|
||||||
| by
|
|
||||||
<a rel="author" class="u-author h-card u-url permalink" href="{{ .source }}">
|
|
||||||
{{ .author.name | safeHTML }}
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</small>
|
|
||||||
</article>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
<br/>
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
|
Loading…
Reference in New Issue