move webmention endpoint into config.toml

This commit is contained in:
Wouter Groeneveld 2022-04-29 14:16:57 +02:00
parent 29de1cea2b
commit 5c93d643e5
8 changed files with 25 additions and 25 deletions

View File

@ -20,6 +20,7 @@ enableGitInfo = true
pagination = 30
description = "Freshly Baked Thoughts"
webmentionServer = "https://jam.brainbaking.com"
accent = "#018661"
showBorder = true
copyright = "&uarr;&nbsp;<a href='#header'>Top</a> <svg class='icon icon-small' width='16' height='16'><title>lightbulb icon</title><use xlink:href='#bulb'></use></svg> <a href='/'>Brain Baking</a>. <a href='/no-copyright-no-tracking'>No &copy; and no tracking</a>."

View File

@ -9,7 +9,7 @@ tags:
Small and independent blogs are always full of surprises. The more blogs I stumble upon, the more genuinely surprised I am by the things people do with their blogs. It seemed like a good idea to summarize highlights here. I hope it might inspire non-bloggers to blog and bloggers to tinker more with their site---because obviously the tinkering never ends!
I randomly selected blogs for each _thing_. There are ample other sites that use that particular feature, but I had to start somewhere. Some blogs appear muiltple times, probably making them even funkier! This list is incomplete, I'll try to periodically update it as I encounter more cool stuff. Enjoy!
I randomly selected blogs for each _thing_. There are ample other sites that use that particular feature, but I had to start somewhere. Some blogs appear multiple times, probably making them even funkier! This list is incomplete, I'll try to periodically update it as I encounter more cool stuff. Enjoy!
### Content related
@ -39,6 +39,7 @@ I randomly selected blogs for each _thing_. There are ample other sites that use
- Use a public inbox as a commenting system: [an article from Drew DeVault](https://drewdevault.com/2022/04/15/Status-update-April-2022.html)
- Implement reaction buttons for each post: [Jan-Lukas Else's thoughts on reactions](https://jlelse.blog/posts/goblog-reactions)
- Emulate the multi-pane layout of an e-mail client: [Brian Lovin's writings](https://brianlovin.com/writing)
- Each post has a unique HTML design/layout: [Aegir's Words](https://aegir.org/words/smoothbooze)
### IndieWeb related
@ -49,7 +50,7 @@ I randomly selected blogs for each _thing_. There are ample other sites that use
- Summarize all IndieWeb-based RSVP events in a calendar: [Jamie Tanna's RSVPs](https://www.jvt.me/rsvps/)
- Work together on MicroPub/Sub as a new social reading protocol: [Neal Mather's blog](https://doubleloop.net/)
- Join the IndieWeb ring to promote own and others' sites: [Horst Gutmann's blog](https://zerokspot.com/)
- Buuild a custom Webmention receiver/sender: [IndieWeb examples](https://indieweb.org/Webmention#IndieWeb_Examples)
- Build a custom Webmention receiver/sender: [IndieWeb examples](https://indieweb.org/Webmention#IndieWeb_Examples)
### RSS related
@ -59,7 +60,7 @@ I randomly selected blogs for each _thing_. There are ample other sites that use
- Styled OPML Blogrolls that can be imported into your reader: [Ruben Schade's Omake OPML](https://rubenerd.com/omake.opml)
- Styled RSS feeds to better explain what a web feed is: [Matt Webb's RSS feed](http://interconnected.org/home/feed)
- A "Reply via email" link in each RSS post to encourage interaction: [Mike Harley's RSS feed](view-source:https://obsolete29.com/feed/feed.xml)
- Secret RSS-only posts that do not appear on the webiste: [Ton Zijlstra's RSS feed](https://www.zylstra.org/blog/feed/)
- Secret RSS-only posts that do not appear on the website: [Ton Zijlstra's RSS feed](https://www.zylstra.org/blog/feed/)
- Send out newsletters based on your RSS feed: [Kev Quirk is newslettering again](https://kevq.uk/im-newslettering-again/) (defunct)
- Add the location from where you write to your RSS feed: [Ruben Schade's RSS feed](https://rubenerd.com/feed)

13
hooks/_conf.js Normal file
View File

@ -0,0 +1,13 @@
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
};

View File

@ -1,14 +1,6 @@
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
};
const wmconfig = require('./_conf.js');
(async function() {
// 1. send webmentions

View File

@ -1,15 +1,7 @@
const { mastodon, goodreads, lunr, 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
};
const wmconfig = require('./_conf.js');
const rootdir = `${__dirname}/../`;

File diff suppressed because one or more lines are too long

View File

@ -8,8 +8,8 @@
<link rel="me" title="Mastodon" href="{{ .Site.Author.mastodonlink }}" />
<link rel="me" title="Github" href="{{ .Site.Author.githublink }}" />
<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" />
<link rel="webmention" href="{{ .Site.Params.webmentionServer }}/webmention" />
<link rel="pingback" href="{{ .Site.Params.webmentionServer }}/pingback" />
<!-- meta data tags, open graph -->
<meta name="twitter:title" content="{{ .Title }}" property="og:title">

View File

@ -1,4 +1,5 @@
{{ $mentions := (where .Site.Data.webmentions "relativeTarget" "==" $.RelPermalink) }}
{{ $wmServer := .Site.Params.webmentionServer }}
{{ if $mentions }}
<h4 class="page-header" id="mentions">
@ -34,7 +35,7 @@
<a rel="author" class="u-author h-card u-url permalink" href="{{ .source }}">
{{ if isset .author "picture" }}
<div class="avatar">
<img class="u-photo" loading="lazy" src="https://jam.brainbaking.com{{ .author.picture | safeHTML }}" alt="{{ $name }}" />
<img class="u-photo" loading="lazy" src="{{ $wmServer }}{{ .author.picture | safeHTML }}" alt="{{ $name }}" />
</div>
{{ else }}
<div class="avatar">