diff options
author | Fabien CASTERS <fabien@vaga.io> | 2021-03-05 14:01:56 +0300 |
---|---|---|
committer | Fabien <vaga@users.noreply.github.com> | 2021-03-05 14:29:43 +0300 |
commit | 0b0e233a3e7ad2140104cb584b6094f352e8aa21 (patch) | |
tree | 19626e67346f9d68d6ba7e9861728658273be965 | |
parent | e6b9b635062ee7f4c2a95d06535be95640a1a201 (diff) |
rename params.social.name to params.social.icon
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | exampleSite/config.toml | 4 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 6 |
3 files changed, 7 insertions, 5 deletions
@@ -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 @@ </nav> {{- end }} <p>{{ .Site.Params.description | default "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vehicula turpis sit amet elit pretium." }}</p> + {{- with .Site.Params.social }} <div class="app-header-social"> - {{ range .Site.Params.social }} - <a target="_blank" href="{{ .url }}" rel="noreferrer noopener">{{ partial "icon.html" (dict "ctx" $ "name" .name ) }}</a> + {{ range . }} + <a href="{{ .url }}" target="_blank" rel="noreferrer noopener">{{ partial "icon.html" (dict "ctx" $ "name" .icon) }}</a> {{ end }} </div> + {{- end }} </header> <main class="app-container"> {{ block "main" . }} |