Support for displaying webmentions
This commit is contained in:
parent
f1b903fb49
commit
b66a0fd89a
|
@ -633,6 +633,33 @@ select {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mentions {
|
||||||
|
@include subarticle-element;
|
||||||
|
line-height: 1.5;
|
||||||
|
display: block;
|
||||||
|
@media screen and (max-width: $break1) {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.caption {
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
.mentions-list {
|
||||||
|
margin-top: 5px;
|
||||||
|
list-style: none;
|
||||||
|
.item {
|
||||||
|
.link {
|
||||||
|
.post-title {
|
||||||
|
margin-bottom: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
font-size: .8125rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* List content */
|
/* List content */
|
||||||
.list {
|
.list {
|
||||||
.list-item {
|
.list-item {
|
||||||
|
|
|
@ -51,4 +51,7 @@
|
||||||
translation: "Related"
|
translation: "Related"
|
||||||
|
|
||||||
- id: share
|
- id: share
|
||||||
translation: "Share"
|
translation: "Share"
|
||||||
|
|
||||||
|
- id: interactions
|
||||||
|
translation: "Interactions"
|
|
@ -23,14 +23,7 @@
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<link rel="canonical" href="{{ .Permalink }}">
|
<link rel="canonical" href="{{ .Permalink }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{- if .Param "indieweb.enabled" }}
|
{{ partial "indiewebhead" . }}
|
||||||
{{- with .Param "indieweb.endpoints.webmention" }}
|
|
||||||
<link rel="webmention" href="{{ . }}" />
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Param "indieweb.endpoints.pingback" }}
|
|
||||||
<link rel="pingback" href="{{ . }}" />
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{ partial "customhead" . }}
|
{{ partial "customhead" . }}
|
||||||
</head>
|
</head>
|
||||||
<body class="body">
|
<body class="body">
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
{{- $mentions := .Site.Data.mentions -}}
|
||||||
|
{
|
||||||
|
"version": "https://jsonfeed.org/version/1",
|
||||||
|
"title": "{{ T "interactions" }} {{ .Site.Title }}",
|
||||||
|
"feed_url": "{{ .Permalink }}",
|
||||||
|
"items": [
|
||||||
|
{{ $delimiter := "" -}}
|
||||||
|
{{- range $key, $pagementions := $mentions -}}
|
||||||
|
{{- range $pagekey, $mention := $pagementions -}}
|
||||||
|
{{- $delimiter -}}{
|
||||||
|
"id": "{{ $key }}{{ $pagekey }}",
|
||||||
|
"url": "{{ $mention.source }}",
|
||||||
|
"date_published": "{{ dateFormat "2006-01-02T15:04:05-07:00" $mention.date }}"
|
||||||
|
}
|
||||||
|
{{- $delimiter = "," -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end }}
|
||||||
|
]
|
||||||
|
}
|
|
@ -23,5 +23,6 @@
|
||||||
{{ partial "authorbox.html" . }}
|
{{ partial "authorbox.html" . }}
|
||||||
</main>
|
</main>
|
||||||
{{ partial "webmentionform" . }}
|
{{ partial "webmentionform" . }}
|
||||||
|
{{ partial "mentions.html" . }}
|
||||||
{{ partial "post_nav.html" . }}
|
{{ partial "post_nav.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
|
@ -0,0 +1,17 @@
|
||||||
|
{{- if .Param "indieweb.enabled" }}
|
||||||
|
{{- with .Param "indieweb.endpoints.webmention" }}
|
||||||
|
<link rel="webmention" href="{{ . }}" />
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Param "indieweb.endpoints.pingback" }}
|
||||||
|
<link rel="pingback" href="{{ . }}" />
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Param "indieweb.endpoints.auth_endpoint" }}
|
||||||
|
<link rel="authorization_endpoint" href="{{ . }}" />
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Param "indieweb.endpoints.token_endpoint" }}
|
||||||
|
<link rel="token_endpoint" href="{{ . }}" />
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Param "indieweb.endpoints.micropub" }}
|
||||||
|
<link rel="micropub" href="{{ . }}" />
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
|
@ -0,0 +1,18 @@
|
||||||
|
{{ if .Param "indieweb.enabled" }}
|
||||||
|
{{ $md5pl := md5 .Permalink }}
|
||||||
|
{{ $mentions := index .Site.Data.mentions $md5pl }}
|
||||||
|
{{ $dateFormat := ( .Site.Params.dateformat | default "January 02, 2006") }}
|
||||||
|
{{ with $mentions }}
|
||||||
|
<div class="mentions">
|
||||||
|
<details>
|
||||||
|
<summary class="caption">{{ T "interactions" }}</summary>
|
||||||
|
<ul class="mentions-list">
|
||||||
|
{{ range . }}
|
||||||
|
{{ $sourceUrl := urls.Parse .source }}
|
||||||
|
<li class="item"><a href="{{ .source }}" target="_blank" rel="nofollow noopener">{{ $sourceUrl.Host }}</a> <i>{{ dateFormat $dateFormat .date }}</i></li>
|
||||||
|
{{ end }}
|
||||||
|
</ul>
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
Reference in New Issue