mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-13 00:14:05 +00:00
contact.html: Shorten code for autolinks (#49)
Signed-off-by: Stephan Kulla <git.mail@kulla.me>
This commit is contained in:
1 parent
7763b7dcba
commit
fe04cf84b9
1 file changed
+7
-10
@@ -1,5 +1,6 @@
|
||||
{{ $ := .root }}
|
||||
{{ $page := .page }}
|
||||
{{ $autolink := default true $page.Params.autolink }}
|
||||
|
||||
<!-- Contact widget -->
|
||||
<section id="contact" class="home-section">
|
||||
@@ -18,11 +19,9 @@
|
||||
{{ with $.Site.Params.email }}
|
||||
<li>
|
||||
<i class="fa fa-envelope fa-fw big-icon" aria-hidden="true"></i>
|
||||
{{ if and (isset $.Params "autolink") (eq $.Params.autolink false) }}
|
||||
<span>{{ . }}</span>
|
||||
{{ else }}
|
||||
<span><a href="mailto:{{ . }}">{{ . }}</a></span>
|
||||
{{ end }}
|
||||
<span>
|
||||
{{- if $autolink }}<a href="mailto:{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end -}}
|
||||
</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
@@ -38,11 +37,9 @@
|
||||
{{ with $.Site.Params.phone }}
|
||||
<li>
|
||||
<i class="fa fa-phone fa-fw big-icon" aria-hidden="true"></i>
|
||||
{{ if and (isset $.Params "autolink") (eq $.Params.autolink false) }}
|
||||
<span>{{ . }}</span>
|
||||
{{ else }}
|
||||
<span><a href="tel:{{ . }}">{{ . }}</a></span>
|
||||
{{ end }}
|
||||
<span>
|
||||
{{- if $autolink }}<a href="tel:{{ . }}">{{ . }}</a>{{ else }}{{ . }}{{ end -}}
|
||||
</span>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
|
||||
Reference in new issue
Block a user