minor tweaks to received webmentions
This commit is contained in:
parent
16790a585c
commit
145377cf90
|
@ -1 +1,16 @@
|
|||
[]
|
||||
[
|
||||
{
|
||||
"content": "Recommended read: The IndieWeb Mixed Bag - Thoughts about the (d)evolution of blog interactions",
|
||||
"author": {
|
||||
"name": "Jamie Tanna",
|
||||
"picture": "https://www.jvt.me/img/profile.png"
|
||||
},
|
||||
"published": "2021-03-15T12:42:00+0000",
|
||||
"type": "mention",
|
||||
"url": "https://www.jvt.me/mf2/2021/03/1bkre/",
|
||||
"source": "https://www.jvt.me/mf2/2021/03/1bkre/",
|
||||
"target": "https://brainbaking.com/post/2021/03/the-indieweb-mixed-bag/",
|
||||
"publishedFromNow": "a day ago",
|
||||
"relativeTarget": "/post/2021/03/the-indieweb-mixed-bag/"
|
||||
}
|
||||
]
|
|
@ -28,7 +28,7 @@ const fsp = require('fs').promises;
|
|||
// 4. get webmentions
|
||||
console.log("4. Fetching webmentions that aren't likes...")
|
||||
const mentions = await webmention.getWebmentions("brainbaking.com")
|
||||
const json = JSON.stringify(mentions.filter(m => m.content && m.type !== "like"))
|
||||
const json = JSON.stringify(mentions, null, 4)
|
||||
await fsp.writeFile(`${__dirname}/data/webmentions.json`, json, 'utf-8')
|
||||
|
||||
console.log("-- all done!")
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -8,6 +8,7 @@
|
|||
|
||||
&:hover
|
||||
border-color: var(--accent)
|
||||
box-shadow: rgba(100, 100, 111, 0.2) 5px 17px 29px 5px
|
||||
|
||||
.notes
|
||||
.u-photo
|
||||
|
@ -19,6 +20,7 @@
|
|||
|
||||
img
|
||||
width: 60px
|
||||
height: 60px
|
||||
|
||||
.tootlist
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{{ if (not .Params.disableComments) }}
|
||||
|
||||
{{ $mentions := (where .Site.Data.webmentions "target" "==" $.RelPermalink) }}
|
||||
{{ $mentions := (where .Site.Data.webmentions "relativeTarget" "==" $.RelPermalink) }}
|
||||
|
||||
{{ if $mentions }}
|
||||
<h4 class="page-header">
|
||||
|
@ -25,15 +25,15 @@
|
|||
{{ .published }}
|
||||
</time>
|
||||
| by
|
||||
<a rel="author" class="u-author h-card u-url" href="{{ .source }}">
|
||||
<a rel="author" class="u-author h-card u-url permalink" href="{{ .source }}">
|
||||
{{ $name := .author.name | safeHTML }}
|
||||
{{ if isset .author "picture" }}
|
||||
<div class="avatar">
|
||||
<img class="u-photo" src="{{ .author.picture | safeHTML }}" alt="{{ $name }}" />
|
||||
<img class="u-photo" loading="lazy" src="{{ .author.picture | safeHTML }}" alt="{{ $name }}" />
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="avatar">
|
||||
<img class="u-photo" src="/img/avatar-anonymous.jpg" alt="{{ $name }}" />
|
||||
<img class="u-photo" loading="lazy" src="/img/avatar-anonymous.jpg" alt="{{ $name }} anonymous photo" />
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ $name }}
|
||||
|
|
Loading…
Reference in New Issue