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

gitlab.com/rmaguiar/hugo-theme-color-your-world.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/shortcodes/social.html')
-rw-r--r--layouts/shortcodes/social.html76
1 files changed, 39 insertions, 37 deletions
diff --git a/layouts/shortcodes/social.html b/layouts/shortcodes/social.html
index 4b11574..b86c066 100644
--- a/layouts/shortcodes/social.html
+++ b/layouts/shortcodes/social.html
@@ -1,55 +1,57 @@
-<!-- Reduce repetition... -->
-{{ $centralized := $.Site.Params.Social.Centralized }}
-{{ $decentralized := $.Site.Params.Social.Decentralized }}
+{{ if .Site.Params.Social }}
+ <!-- Reduce repetition... -->
+ {{ $centralized := $.Site.Params.Social.Centralized }}
+ {{ $decentralized := $.Site.Params.Social.Decentralized }}
-<section class="social">
+ <section class="social">
- {{ range .Site.Data.social }}
+ {{ range .Site.Data.social }}
- {{ $currentEntry := .entry }}
- {{ $currentLabel := .label }}
- {{ $currentBase := .base }}
- {{ $currentIcon := .icon.id }}
+ {{ $currentEntry := .entry }}
+ {{ $currentLabel := .label }}
+ {{ $currentBase := .base }}
+ {{ $currentIcon := .icon.id }}
- {{ if not .decentralized }}
+ {{ if not .decentralized }}
- {{ with (index $centralized $currentEntry) }}
+ {{ with (index $centralized $currentEntry) }}
- {{ $url := printf "%s%s" $currentBase (index . 0) }}
- {{ $label := $currentLabel }}
-
- {{ with (index . 1) }}
- {{ $label = . }}
- {{ end }}
+ {{ $url := printf "%s%s" $currentBase (index . 0) }}
+ {{ $label := $currentLabel }}
- <a class="btn" href="{{ $url }}" rel="me nofollow" title="{{ $label }}">
- <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
- <use xlink:href="#{{ $currentIcon }}"/>
- </svg>
+ {{ with (index . 1) }}
+ {{ $label = . }}
+ {{ end }}
+
+ <a class="btn" href="{{ $url }}" rel="me nofollow" title="{{ $label }}">
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
+ <use xlink:href="#{{ $currentIcon }}"/>
+ </svg>
- <p>{{ $label }}</p>
- </a>
+ <p>{{ $label }}</p>
+ </a>
- {{ end }}
+ {{ end }}
- {{ else }}
+ {{ else }}
- {{ if (index $decentralized $currentEntry) }}
+ {{ if (index $decentralized $currentEntry) }}
- {{ range (index $decentralized $currentEntry) }}
- <a class="btn" href="{{ index . 0 }}" rel="me nofollow" title="{{ printf "%s (%s)" (index . 1) $currentLabel }}">
- <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
- <use xlink:href="#{{ $currentIcon }}"/>
- </svg>
+ {{ range (index $decentralized $currentEntry) }}
+ <a class="btn" href="{{ index . 0 }}" rel="me nofollow" title="{{ printf "%s (%s)" (index . 1) $currentLabel }}">
+ <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
+ <use xlink:href="#{{ $currentIcon }}"/>
+ </svg>
- <p>{{ index . 1 | truncate 15 }}</p>
- </a>
+ <p>{{ index . 1 | truncate 15 }}</p>
+ </a>
+ {{ end }}
+
{{ end }}
{{ end }}
-
- {{ end }}
- {{ end }}
+ {{ end }}
-</section> \ No newline at end of file
+ </section>
+{{ end }} \ No newline at end of file