parent
97fb468078
commit
1009e6f756
File diff suppressed because it is too large
Load Diff
@ -1,13 +0,0 @@
|
||||
const { readFileSync } = require('fs');
|
||||
|
||||
if(!process.env.WEBMENTION_TOKEN) {
|
||||
throw "No webmention token set!"
|
||||
}
|
||||
|
||||
const configToml = readFileSync(`${__dirname}/../config.toml`)
|
||||
const endpoint = /webmentionServer = \"(.+)\"/.exec(configToml)[1]
|
||||
|
||||
module.exports = {
|
||||
endpoint,
|
||||
token: process.env.WEBMENTION_TOKEN
|
||||
};
|
@ -1,12 +1,5 @@
|
||||
|
||||
const { webmention } = require('jam-my-stack');
|
||||
const wmconfig = require('./_conf.js');
|
||||
|
||||
(async function() {
|
||||
// 1. send webmentions
|
||||
console.log("1. Sending webmentions...")
|
||||
const since = await webmention.send("brainbaking.com", wmconfig)
|
||||
console.log(` -- done`)
|
||||
|
||||
console.log("-- all done!")
|
||||
console.log("-- postdeploy: all done!")
|
||||
})()
|
||||
|
@ -1,24 +1,24 @@
|
||||
|
||||
const { mastodon, goodreads, webmention, youtube } = require('jam-my-stack');
|
||||
const { mastodon, webmention, youtube } = require('jam-my-stack');
|
||||
const fsp = require('fs').promises;
|
||||
const wmconfig = require('./_conf.js');
|
||||
|
||||
const rootdir = `${__dirname}/../`;
|
||||
|
||||
(async function() {
|
||||
// 1. get webmentions
|
||||
console.log("1. Fetching webmentions...")
|
||||
// get webmentions (turned off, 08/05/2023)
|
||||
/*
|
||||
console.log("-- Fetching webmentions...")
|
||||
const mentions = await webmention.getWebmentions("brainbaking.com", wmconfig)
|
||||
const json = JSON.stringify(mentions, null, 4)
|
||||
await fsp.writeFile(`${rootdir}/data/webmentions.json`, json, 'utf-8')
|
||||
*/
|
||||
|
||||
// 2. generate youtube thumbnails
|
||||
console.log("2. Generating YouTube thumbnails...")
|
||||
console.log("--> Generating YouTube thumbnails...")
|
||||
await youtube.thumbify({
|
||||
postDir: `${rootdir}/content/post`,
|
||||
downloadDir: `${rootdir}/static/img/yt`,
|
||||
overlayImg: `${rootdir}/play.png`
|
||||
})
|
||||
|
||||
console.log("-- all done!")
|
||||
console.log("-- precommit: all done!")
|
||||
})()
|
||||
|
@ -1,59 +0,0 @@
|
||||
{{ $mentions := (where (where (where .Site.Data.webmentions "relativeTarget" "==" $.RelPermalink) "content" "!=" "") "type" "!=" "like") }}
|
||||
{{ $wmServer := .Site.Params.webmentionServer }}
|
||||
|
||||
{{ if $mentions }}
|
||||
<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>
|
||||
|
||||
<small>
|
||||
<div class="tootlist" style="margin-bottom: -3rem">
|
||||
{{ $i := 0 }}
|
||||
{{ $done := 0 }}
|
||||
{{ range $mentions }}
|
||||
{{ $i = add $i 1 }}
|
||||
{{ if and (gt $i 5) (eq $done 0) }}
|
||||
{{ $done = 1 }}
|
||||
<a href="#morementions"><button>Show {{ add (sub (len $mentions) $i) 1 }} more...</button></a>
|
||||
<div id="morementions">
|
||||
{{ end }}
|
||||
|
||||
<article class="u-comment h-cite toot">
|
||||
{{ $name := .author.name | safeHTML }}
|
||||
<p class="p-content p-name">
|
||||
{{ if .content }}
|
||||
{{ .content | safeHTML }}
|
||||
{{ else }}
|
||||
{{ $name }} liked this post.
|
||||
{{ end }}
|
||||
</p>
|
||||
<div class="meta">
|
||||
<svg class='icon icon-small'>
|
||||
<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 }}">
|
||||
{{ $name }}
|
||||
</a>
|
||||
</div>
|
||||
</article>
|
||||
{{ end }}
|
||||
{{ if gt $i 5 }}
|
||||
<a href="#mentions"><button>Collapse mentions</button></a>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</small>
|
||||
<br/>
|
||||
{{ end }}
|
||||
|
Loading…
Reference in new issue