Move sponsor data to theme data

So it can be reused
This commit is contained in:
Bjørn Erik Pedersen 2017-11-29 12:57:14 +01:00
parent 41fe75254b
commit de94b49421
No known key found for this signature in database
GPG Key ID: 330E6E2BD4859D8F
3 changed files with 20 additions and 17 deletions

View File

@ -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.

View File

@ -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 = ""

View File

@ -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}}
<section class="{{.classes_section | default "bg-primary-color-dark b--light-gray bb bt ph5 pv4 w-100"}}">
{{ with .cx.Site.Data.sponsors }}
<section class="{{ $.classes_section | default "bg-primary-color-dark b--light-gray bb bt ph5 pv4 w-100"}}">
<div class="center mw9"> 
<f3 class="b f3 light-gray">Hugo Sponsors</f3>
<div class="flex-ns flex-wrap center justify-between pt3">
{{ range $sponsors.Params.sponsors }}
{{ range .banners }}
{{if .logo}}
<div class="{{$classes_box}} o-100">
{{with .link -}}