mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 14:15:47 +00:00
fix: add support for external_link in archives
Improves consistency: external projects are now opened in new tab whether they are viewed from the Portfolio widget or archive page. Fix #1525
This commit is contained in:
1 parent
242479c5ed
commit
de256253f1
1 file changed
+17
-11
+17
-11
@@ -9,18 +9,24 @@
|
||||
|
||||
{{ $paginator := .Paginate .Data.Pages }}
|
||||
{{ range $paginator.Pages }}
|
||||
<div>
|
||||
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
|
||||
<div class="article-style">
|
||||
{{ if .Params.summary }}
|
||||
{{ .Params.summary | plainify | emojify }}
|
||||
{{ else if .Params.abstract }}
|
||||
{{ .Params.abstract | plainify | emojify | truncate 250 }}
|
||||
{{ else if .Summary }}
|
||||
{{ .Summary | plainify | emojify }}
|
||||
{{ end }}
|
||||
{{ $link := .RelPermalink }}
|
||||
{{ $target := "" }}
|
||||
{{ with .Params.external_link }}
|
||||
{{ $link = . }}
|
||||
{{ $target = "target=\"_blank\" rel=\"noopener\"" }}
|
||||
{{ end }}
|
||||
<div>
|
||||
<h2><a href="{{$link}}" {{ $target | safeHTMLAttr }}>{{ .Title }}</a></h2>
|
||||
<div class="article-style">
|
||||
{{ if .Params.summary }}
|
||||
{{ .Params.summary | plainify | emojify }}
|
||||
{{ else if .Params.abstract }}
|
||||
{{ .Params.abstract | plainify | emojify | truncate 250 }}
|
||||
{{ else if .Summary }}
|
||||
{{ .Summary | plainify | emojify }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ partial "pagination" . }}
|
||||
|
||||
Reference in new issue
Block a user