mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 19:15:16 +02:00
contact.html: Shorten code for autolinks (#49)
Signed-off-by: Stephan Kulla <git.mail@kulla.me>
This commit is contained in:
parent
7763b7dcba
commit
fe04cf84b9
1 changed files with 7 additions and 10 deletions
|
@ -1,5 +1,6 @@
|
||||||
{{ $ := .root }}
|
{{ $ := .root }}
|
||||||
{{ $page := .page }}
|
{{ $page := .page }}
|
||||||
|
{{ $autolink := default true $page.Params.autolink }}
|
||||||
|
|
||||||
<!-- Contact widget -->
|
<!-- Contact widget -->
|
||||||
<section id="contact" class="home-section">
|
<section id="contact" class="home-section">
|
||||||
|
@ -18,11 +19,9 @@
|
||||||
{{ with $.Site.Params.email }}
|
{{ with $.Site.Params.email }}
|
||||||
<li>
|
<li>
|
||||||
<i class="fa fa-envelope fa-fw big-icon" aria-hidden="true"></i>
|
<i class="fa fa-envelope fa-fw big-icon" aria-hidden="true"></i>
|
||||||
{{ if and (isset $.Params "autolink") (eq $.Params.autolink false) }}
|
<span>
|
||||||
<span>{{ . }}</span>
|
{{- if $autolink }}<a href="mailto:{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end -}}
|
||||||
{{ else }}
|
</span>
|
||||||
<span><a href="mailto:{{ . }}">{{ . }}</a></span>
|
|
||||||
{{ end }}
|
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
@ -38,11 +37,9 @@
|
||||||
{{ with $.Site.Params.phone }}
|
{{ with $.Site.Params.phone }}
|
||||||
<li>
|
<li>
|
||||||
<i class="fa fa-phone fa-fw big-icon" aria-hidden="true"></i>
|
<i class="fa fa-phone fa-fw big-icon" aria-hidden="true"></i>
|
||||||
{{ if and (isset $.Params "autolink") (eq $.Params.autolink false) }}
|
<span>
|
||||||
<span>{{ . }}</span>
|
{{- if $autolink }}<a href="tel:{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end -}}
|
||||||
{{ else }}
|
</span>
|
||||||
<span><a href="tel:{{ . }}">{{ . }}</a></span>
|
|
||||||
{{ end }}
|
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue