From b031608ee4cc1d2568bbff5e6c40c0d092f21a50 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sat, 30 Sep 2017 22:50:58 +0100 Subject: [PATCH] about widget: Allow for multiple organizations (Close #132) - Remove `organization` and `organization_url` options from config - Add `organizations = [ {name="Org Name", url=""} ]` - Continue to support legacy options - Only show `role` if it is set --- exampleSite/config.toml | 7 +++++-- layouts/partials/widgets/about.html | 12 +++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 2be09582..a033d601 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -35,8 +35,11 @@ defaultContentLanguageInSubdir = false # Your details. name = "Lena Smith" role = "Professor of Artificial Intelligence" - organization = "Stanford University" - organization_url = "" + + # Organizations/Affiliations. + # Separate multiple entries with a comma, using the form: `[ {name="Org1", url=""}, {name="Org2", url=""} ]`. + organizations = [ { name = "Stanford University", url = "" } ] + gravatar = false # Get your avatar from Gravatar.com? (true/false) avatar = "portrait.jpg" # Specify an avatar image (in `static/img/` folder) or delete value to disable avatar. email = "test@example.org" diff --git a/layouts/partials/widgets/about.html b/layouts/partials/widgets/about.html index 08b32576..c05b5ce0 100644 --- a/layouts/partials/widgets/about.html +++ b/layouts/partials/widgets/about.html @@ -16,7 +16,9 @@

{{ $.Site.Params.name }}

-

{{ $.Site.Params.role }}

+ {{ with $.Site.Params.role }}

{{ . }}

{{ end }} + + {{/* Support legacy `organization` option. */}} {{ if $.Site.Params.organization }}

{{ with $.Site.Params.organization_url }}{{ end }}

{{ end }} + + {{ range $.Site.Params.organizations }} +

+ {{ with .url }}{{ end }} +

+ {{ end }}