jlelse
/
Indieroad
Archived
1
Fork 0

Add back lightbox

This commit is contained in:
Jan-Lukas Else 2020-03-21 00:22:56 +01:00
parent 2bfdde2b93
commit 63e7bb1cef
6 changed files with 10 additions and 2 deletions

View File

@ -0,0 +1 @@
<a href="#{{ .Destination | md5 }}-lightbox"><img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} /></a>

View File

@ -26,7 +26,7 @@
"id": "{{ .Permalink }}",
"url": "{{ .Permalink }}",
"title": {{ .Title | jsonify }},
"content_html": {{ .Content | jsonify }},
"content_html": {{ partial "cleanedContent.json" . }},
"summary": {{ .Summary | jsonify }},
"date_published": {{ dateFormat "2006-01-02T15:04:05-07:00" .Date | jsonify }},
"date_modified": {{ dateFormat "2006-01-02T15:04:05-07:00" .Lastmod | jsonify }},

View File

@ -28,7 +28,7 @@
<link>{{ .Permalink }}</link>
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
<guid>{{ .Permalink }}</guid>
<description>{{ .Content | html }}</description>
<description>{{ partial "cleanedContent.xml" . }}</description>
</item>
{{ end }}
</channel>

View File

@ -17,6 +17,11 @@
<p><audio controls preload="metadata" style="width: 100%;"><source src="{{ . }}"/></audio></p>
{{ end }}
{{ .Content }}
{{ range $i, $image := .Params.images }}
<a href="#_" class="lightbox" id="{{ $image | md5 }}-lightbox">
<img src="{{ $image | safeURL }}">
</a>
{{ end }}
{{ with .Params.externalUrl }}
<p><a class="u-bookmark-of" href="{{ . }}" target="_blank">{{ . }}</a></p>
{{ end }}

View File

@ -0,0 +1 @@
{{ (( htmlUnescape .Content | safeHTML ) | replaceRE "<a href=\".*lightbox\">(.*)</a>" "$1" | replaceRE "href=\"/([^\"]*)\"" ( printf "href=\"%s$1\"" ( "" | absURL ) ) ) | jsonify }}

View File

@ -0,0 +1 @@
{{ (( htmlUnescape .Content | safeHTML ) | replaceRE "<a href=\".*lightbox\">(.*)</a>" "$1" | replaceRE "href=\"/([^\"]*)\"" ( printf "href=\"%s$1\"" ( "" | absURL ) ) ) | html }}