From a074ce33fa38cf59ef5b36c6c9cce2bc957bf51c Mon Sep 17 00:00:00 2001
From: Olivia206 <olivia.simonet@mmibordeaux.com>
Date: Tue, 19 Sep 2023 17:27:08 +0200
Subject: [PATCH] added socials links to footer

---
 assets/sass/_theme/_configuration.sass       |  2 +
 assets/sass/_theme/design-system/footer.sass | 17 +++++++
 layouts/partials/commons/menu.html           |  3 ++
 layouts/partials/footer/social.html          | 52 +++++++++++++++++++-
 4 files changed, 73 insertions(+), 1 deletion(-)

diff --git a/assets/sass/_theme/_configuration.sass b/assets/sass/_theme/_configuration.sass
index 9a21fa83..f059c0e4 100644
--- a/assets/sass/_theme/_configuration.sass
+++ b/assets/sass/_theme/_configuration.sass
@@ -194,6 +194,8 @@ $footer-color: $color-text !default
 $footer-background-color: $color-background-alt !default
 $footer-logo-height: $header-logo-height !default
 $footer-logo-height-desktop: $footer-logo-height !default
+$footer-icons-enabled: false !default
+$footer-text-hidden: false !default
 
 // Hero
 $hero-height: 300px !default
diff --git a/assets/sass/_theme/design-system/footer.sass b/assets/sass/_theme/design-system/footer.sass
index 3f30abab..2261d995 100644
--- a/assets/sass/_theme/design-system/footer.sass
+++ b/assets/sass/_theme/design-system/footer.sass
@@ -31,6 +31,23 @@ footer#document-footer
         &-credit
             display: block
             margin-top: $spacing0
+        @if $footer-icons-enabled
+            &-social li a
+                &.facebook
+                    @include icon(facebook, after)
+                &.instagram
+                    @include icon(instagram, after)
+                &.linkedin
+                    @include icon(linkedin, after)
+                &.mastodon
+                &.youtube
+                &.x
+                &::after
+                    margin-left: $spacing0
+                    font-size: $h3-size
+        @if $footer-text-hidden
+            &-social li
+                font-size: 0
 
     @include media-breakpoint-down(desktop)
         .container
diff --git a/layouts/partials/commons/menu.html b/layouts/partials/commons/menu.html
index 7d261310..a1f6bab2 100644
--- a/layouts/partials/commons/menu.html
+++ b/layouts/partials/commons/menu.html
@@ -24,6 +24,9 @@
     {{ if eq $context.RelPermalink .target }}
       {{ $linkClass = "active" }}
     {{ end }}
+    {{ if eq $kind "social" }}
+      {{- $itemClass = printf .title | lower -}}
+    {{ end }}
     {{- if gt (len .children) 0 -}}
       {{- $itemClass = printf "%shas-children" $itemClass -}}
     {{- end -}}
diff --git a/layouts/partials/footer/social.html b/layouts/partials/footer/social.html
index 4b7cb175..f26b4c33 100644
--- a/layouts/partials/footer/social.html
+++ b/layouts/partials/footer/social.html
@@ -1,5 +1,55 @@
 {{ $menu := partial "GetMenu" "social" }}
-{{ if $menu }}
+{{ $social_links := index site.Data.website.social }}
+
+{{ if $social_links }}
+  <ul class="nav-social nav-level-1">
+    {{ with $social_links.mastodon}}
+    <li>
+      <a href="{{ . }}" rel="noreferrer" title="Mastodon" target="_blank" class="mastodon">Mastodon</a>
+    </li>
+    {{ end}}
+    {{ with $social_links.peertube}}
+    <li>
+      <a href="{{ . }}" rel="noreferrer" title="Peertube" target="_blank" class="peertube">Peertube</a>
+    </li>
+    {{ end}}
+    {{ with $social_links.x}}
+    <li>
+      <a href="{{ . }}" rel="noreferrer" title="X, ex-Twitter" target="_blank" class="x">X</a>
+    </li>
+    {{ end}}
+    {{ with $social_links.linkedin}}
+    <li>
+      <a href="{{ . }}" rel="noreferrer" title="LinkedIn" target="_blank" class="linkedin">LinkedIn</a>
+    </li>
+    {{ end}}
+    {{ with $social_links.youtube}}
+    <li>
+      <a href="{{ . }}" rel="noreferrer" title="Youtube" target="_blank" class="youtube">Youtube</a>
+    </li>
+    {{ end}}
+    {{ with $social_links.vimeo}}
+    <li>
+      <a href="{{ . }}" rel="noreferrer" title="Vimeo" target="_blank" class="vimeo">Vimeo</a>
+    </li>
+    {{ end}}
+    {{ with $social_links.instagram}}
+    <li>
+      <a href="{{ . }}" rel="noreferrer" title="Instagram" target="_blank" class="instagram">Instagram</a>
+    </li>
+    {{ end}}
+    {{ with $social_links.facebook}}
+    <li>
+      <a href="{{ . }}" rel="noreferrer" title="" target="_blank" class="facebook">Facebook</a>
+    </li>
+    {{ end}}
+    {{ with $social_links.tiktok}}
+    <li>
+      <a href="{{ . }}" rel="noreferrer" title="TikTok" target="_blank" class="tiktok">TikTok</a>
+    </li>
+    {{ end}}
+  </ul>
+{{ else if $menu }}
   {{ partial "commons/menu.html"
     (dict
       "kind"        "social"
-- 
GitLab