From 0b0e233a3e7ad2140104cb584b6094f352e8aa21 Mon Sep 17 00:00:00 2001 From: Fabien CASTERS Date: Fri, 5 Mar 2021 12:01:56 +0100 Subject: rename params.social.name to params.social.icon --- README.md | 2 +- exampleSite/config.toml | 4 ++-- layouts/_default/baseof.html | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1b67988..c506cd3 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ To add a social link, add the following lines in `params`: ``` [[params.social]] - name = "github" + icon = "github" url = "https://github.com/vaga" ``` diff --git a/exampleSite/config.toml b/exampleSite/config.toml index c551e8d..b3c9036 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -19,10 +19,10 @@ paginate = 5 description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vehicula turpis sit amet elit pretium." menu_item_separator = " - " [[params.social]] - name = "github" + icon = "github" url = "https://github.com/gohugoio" [[params.social]] - name = "twitter" + icon = "twitter" url = "https://twitter.com/gohugoio" # Brown theme diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index cccdf56..d4fb410 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -31,11 +31,13 @@ {{- end }}

{{ .Site.Params.description | default "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vehicula turpis sit amet elit pretium." }}

+ {{- with .Site.Params.social }}
- {{ range .Site.Params.social }} - {{ partial "icon.html" (dict "ctx" $ "name" .name ) }} + {{ range . }} + {{ partial "icon.html" (dict "ctx" $ "name" .icon) }} {{ end }}
+ {{- end }}
{{ block "main" . }} -- cgit v1.2.3