Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kakawait/hugo-tranquilpeak-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkvaps <kvapss@gmail.com>2019-08-22 14:35:46 +0300
committerThibaud Lepretre <thibaud.lepretre@gmail.com>2021-08-11 15:02:36 +0300
commit16763796503454e9cd666e0c644f079c1f0df96d (patch)
treeb967ecf59621f01ee0172db549eb26c25396f49e /layouts
parente501055d65b67da388147eece55672de30e0bdc8 (diff)
add link posts support
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/summary.html18
1 files changed, 15 insertions, 3 deletions
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html
index d880744..4a0ee91 100644
--- a/layouts/_default/summary.html
+++ b/layouts/_default/summary.html
@@ -25,7 +25,11 @@
<article class="postShorten postShorten--thumbnailimg-{{ .Scratch.Get "thumbnailImagePosition" }}" itemscope itemType="http://schema.org/BlogPosting">
<div class="postShorten-wrap">
{{ if and (.Scratch.Get "thumbnailImage") (eq (.Scratch.Get "thumbnailImagePosition") "top")}}
- <a href="{{ .Permalink }}">
+ {{ with .Params.link }}
+ <a href="{{ . | absURL }}" target="_blank">
+ {{ else }}
+ <a href="{{ $.Permalink }}">
+ {{ end }}
<div class="postShorten-thumbnailimg">
<img alt="" itemprop="image" src="{{ .Scratch.Get "thumbnailImage" }}"/>
</div>
@@ -33,7 +37,11 @@
{{ end }}
<div class="postShorten-header">
<h1 class="postShorten-title" itemprop="headline">
- <a class="link-unstyled" href="{{ .Permalink }}">
+ {{ with .Params.link }}
+ <a class="link-unstyled" href="{{ . | absURL }}" target="_blank">
+ {{ else }}
+ <a class="link-unstyled" href="{{ $.Permalink }}">
+ {{ end }}
{{ .Title }}
</a>
</h1>
@@ -46,7 +54,11 @@
{{ .Summary }}
{{ end }}
<p>
- <a href="{{ .Permalink }}" class="postShorten-excerpt_link link">{{ i18n "post.read_more" }}</a>
+ {{ with .Params.link }}
+ <a href="{{ . | absURL }}" class="postShorten-excerpt_link link" target="_blank">{{ i18n "post.read_more" }}</a>
+ {{ else }}
+ <a href="{{ $.Permalink }}" class="postShorten-excerpt_link link">{{ i18n "post.read_more" }}</a>
+ {{ end }}
{{ with .Params.readingtime }}
<span class="postShorten-readingtime">
{{ printf " - %s min read" . }}