mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 03:00:50 +02:00
projects: Open external link in new tab
This commit is contained in:
parent
bdb68fdf7d
commit
a741bc6db8
2 changed files with 6 additions and 3 deletions
|
@ -33,7 +33,7 @@
|
|||
{{ if .Content }}
|
||||
<a href="{{ .Permalink }}">
|
||||
{{ else }}
|
||||
{{ with .Params.external_link }}<a href="{{ . }}">{{ end }}
|
||||
{{ with .Params.external_link }}<a href="{{ . }}" target="_blank">{{ end }}
|
||||
{{ end }}
|
||||
<i class="fa-li fa fa-files-o pub-icon" aria-hidden="true"></i>
|
||||
{{ .Title }}
|
||||
|
@ -52,13 +52,16 @@
|
|||
|
||||
{{ range $project := where $.Data.Pages "Type" "project" }}
|
||||
{{ $.Scratch.Set "project_url" $project.Permalink }}
|
||||
{{ $.Scratch.Set "target" "" }}
|
||||
{{ if $project.Params.external_link }}
|
||||
{{ $.Scratch.Set "project_url" $project.Params.external_link }}
|
||||
{{ $.Scratch.Set "target" "target=\"_blank\"" }}
|
||||
{{ end }}
|
||||
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-6 project-item isotope-item {{ delimit .Params.tags " " }}">
|
||||
<div class="card">
|
||||
{{ with $project.Params.image_preview }}
|
||||
<a href="{{ $.Scratch.Get "project_url" }}" title="" class="card-image hover-overlay">
|
||||
<a href="{{ $.Scratch.Get "project_url" }}" title="" class="card-image hover-overlay"
|
||||
{{ $.Scratch.Get "target" | safeHTMLAttr }}>
|
||||
<img src="{{ "/img/" | relURL }}{{ . }}" alt="" class="img-responsive">
|
||||
</a>
|
||||
{{ end }}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<h1 itemprop="name">{{ .Title }}</h1>
|
||||
|
||||
{{ with .Params.external_link }}
|
||||
<a class="btn btn-primary btn-outline" href="{{ . }}">{{ i18n "open_project_site" }}</a>
|
||||
<a class="btn btn-primary btn-outline" href="{{ . }}" target="_blank">{{ i18n "open_project_site" }}</a>
|
||||
{{ end }}
|
||||
|
||||
<div class="article-style" itemprop="articleBody">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue