Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/curttimson/hugo-theme-dopetrope.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCurtis Timson <curt@live.co.uk>2018-02-24 12:10:15 +0300
committerCurtis Timson <curt@live.co.uk>2018-02-24 12:10:15 +0300
commit21d8d878ade7595ecb80681510386d797fbc76dc (patch)
tree9ea7d418850892100da56054d60fbbe35643c676
parente24761e529cdda48d8ee0d7fb02364ebeeef6495 (diff)
:sparkles: Drive intro content from data instead of config
-rw-r--r--exampleSite/data/home/intro.yaml12
-rw-r--r--layouts/partials/intro.html21
-rw-r--r--package.json2
3 files changed, 25 insertions, 10 deletions
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 @@
<!-- Intro -->
+{{ $section1 := index .Site.Data.home.intro.sections 0 }}
+{{ $section2 := index .Site.Data.home.intro.sections 1 }}
+{{ $section3 := index .Site.Data.home.intro.sections 2 }}
<section id="intro" class="container">
<div class="row">
<div class="4u 12u(mobile)">
<section class="first">
- <i class='icon featured {{ .Site.Params.Intro.icon1 }}'></i>
+ <i class='icon featured {{ $section1.icon }}'></i>
<header>
- <h2>{{ .Site.Params.Intro.title1 }}</h2>
+ <h2>{{ $section1.title }}</h2>
</header>
- <p>{{ .Site.Params.Intro.description1 }}</p>
+ <p>{{ $section1.description }}</p>
</section>
</div>
<div class="4u 12u(mobile)">
<section class="middle">
- <i class="icon featured alt {{ .Site.Params.Intro.icon2 }}"></i>
+ <i class="icon featured alt {{ $section2.icon }}"></i>
<header>
- <h2>{{ .Site.Params.Intro.title2 }}</h2>
+ <h2>{{ $section2.title }}</h2>
</header>
- <p>{{ .Site.Params.Intro.description2 }}</p>
+ <p>{{ $section2.description }}</p>
</section>
</div>
<div class="4u 12u(mobile)">
<section class="last">
- <i class="icon featured alt2 {{ .Site.Params.Intro.icon3 }}"></i>
+ <i class="icon featured alt2 {{ $section3.icon }}"></i>
<header>
- <h2>{{ .Site.Params.Intro.title3 }}</h2>
+ <h2>{{ $section3.title }}</h2>
</header>
- <p>{{ .Site.Params.Intro.description3 }}</p>
+ <p>{{ $section3.description }}</p>
</section>
</div>
</div>
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": {