From de94b49421803eeb56aed643e1880ee5faf5a306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 29 Nov 2017 12:57:14 +0100 Subject: [PATCH] Move sponsor data to theme data So it can be reused --- content/_index.md | 13 ------------- themes/gohugoioTheme/data/sponsors.toml | 17 +++++++++++++++++ .../partials/home-page-sections/sponsors.html | 7 +++---- 3 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 themes/gohugoioTheme/data/sponsors.toml diff --git a/content/_index.md b/content/_index.md index e6a6690be..ec8883c44 100644 --- a/content/_index.md +++ b/content/_index.md @@ -44,19 +44,6 @@ sections: color_classes: bg-primary-color-light black image: /images/home-page-templating-example.png copy: "Hugo's Go-based templating provides just the right amount of logic to build anything from the simple to complex. If you prefer Jade/Pug-like syntax, you can also use Amber, Ace, or any combination of the three." -sponsors: - - name: "Forestry.io" - link: https://forestry.io/ - logo: /images/sponsors/forestry-logotype.svg - copy: - - name: - link: - logo: - copy: - - name: - link: - logo: - copy: --- Hugo is one of the most popular open-source static site generators. With its amazing speed and flexibility, Hugo makes building websites fun again. diff --git a/themes/gohugoioTheme/data/sponsors.toml b/themes/gohugoioTheme/data/sponsors.toml new file mode 100644 index 000000000..03e89745f --- /dev/null +++ b/themes/gohugoioTheme/data/sponsors.toml @@ -0,0 +1,17 @@ +[[banners]] +name = "Forestry.io" +link = "https://forestry.io/" +logo = "/images/sponsors/forestry-logotype.svg" +copy = "" + +[[banners]] +name = "" +link = "" +logo = "" +copy = "" + +[[banners]] +name = "" +link = "" +logo = "" +copy = "" \ No newline at end of file diff --git a/themes/gohugoioTheme/layouts/partials/home-page-sections/sponsors.html b/themes/gohugoioTheme/layouts/partials/home-page-sections/sponsors.html index 606391704..4d32fc5d6 100644 --- a/themes/gohugoioTheme/layouts/partials/home-page-sections/sponsors.html +++ b/themes/gohugoioTheme/layouts/partials/home-page-sections/sponsors.html @@ -1,11 +1,10 @@ -{{$sponsors := .cx.Site.GetPage "home"}} {{$classes_box := "ba b--light-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l "}} -{{if $sponsors.Params.sponsors}} -
+{{ with .cx.Site.Data.sponsors }} +
  Hugo Sponsors
- {{ range $sponsors.Params.sponsors }} + {{ range .banners }} {{if .logo}}
{{with .link -}}