From 21d8d878ade7595ecb80681510386d797fbc76dc Mon Sep 17 00:00:00 2001 From: Curtis Timson Date: Sat, 24 Feb 2018 09:10:15 +0000 Subject: :sparkles: Drive intro content from data instead of config --- exampleSite/data/home/intro.yaml | 12 ++++++++++++ layouts/partials/intro.html | 21 ++++++++++++--------- package.json | 2 +- 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 exampleSite/data/home/intro.yaml diff --git a/exampleSite/data/home/intro.yaml b/exampleSite/data/home/intro.yaml new file mode 100644 index 0000000..4f94344 --- /dev/null +++ b/exampleSite/data/home/intro.yaml @@ -0,0 +1,12 @@ +sections: +- icon: 'sdsd' + title: 'text' + description: '1 des' + +- icon: 'sdsd' + title: 'texsdsdt' + description: '1 des' + +- icon: 'sdsd' + title: 'text' + description: '1 des' \ No newline at end of file diff --git a/layouts/partials/intro.html b/layouts/partials/intro.html index b76fabd..55932af 100644 --- a/layouts/partials/intro.html +++ b/layouts/partials/intro.html @@ -1,31 +1,34 @@ +{{ $section1 := index .Site.Data.home.intro.sections 0 }} +{{ $section2 := index .Site.Data.home.intro.sections 1 }} +{{ $section3 := index .Site.Data.home.intro.sections 2 }}
- +
-

{{ .Site.Params.Intro.title1 }}

+

{{ $section1.title }}

-

{{ .Site.Params.Intro.description1 }}

+

{{ $section1.description }}

- +
-

{{ .Site.Params.Intro.title2 }}

+

{{ $section2.title }}

-

{{ .Site.Params.Intro.description2 }}

+

{{ $section2.description }}

- +
-

{{ .Site.Params.Intro.title3 }}

+

{{ $section3.title }}

-

{{ .Site.Params.Intro.description3 }}

+

{{ $section3.description }}

diff --git a/package.json b/package.json index cf2dd74..9816863 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hugo-theme-dopetrope", - "version": "3.2.1", + "version": "4.0.0", "description": "Hugo Theme Dopetrope", "main": "index.js", "scripts": { -- cgit v1.2.3