From a7d8f69fb8c733fa1fd244eba76e4d85ba149e44 Mon Sep 17 00:00:00 2001 From: lucperkins Date: Sat, 4 Aug 2018 13:24:03 +0200 Subject: [PATCH] Begin templatizing configuration --- README.md | 6 +- exampleSite/config.yaml | 36 ++++++++++- fresh.png => images/screenshot.png | Bin layouts/partials/hero-body.html | 20 +++++-- layouts/partials/hero-footer.html | 14 +++-- layouts/partials/section1.html | 92 +++++++++++------------------ 6 files changed, 95 insertions(+), 73 deletions(-) rename fresh.png => images/screenshot.png (100%) diff --git a/README.md b/README.md index 038e31a..73ead1c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # The Fresh theme for Hugo -**Fresh** is a theme for the [Hugo](https://gohugo.io) static site generator adapted from the gorgeous, [Bulma](https://bulma.io)-based theme of the same name from [CSS Ninja](https://cssninja.io). +**Fresh** is a theme for the [Hugo](https://gohugo.io) static site generator adapted from the gorgeous, [Bulma](https://bulma.io)-based theme of the same name from [CSS Ninja](https://cssninja.io/themes/fresh). You can find a live demo of the original theme [here](https://cssninjastudio.github.io). -![Fresh theme logo](fresh.png) +![Fresh theme logo](images/screenshot.png) > This theme is for landing pages only. If you'd like to extend the theme to include other types of pages—blog posts, documentation pages, etc.—feel free to submit a pull request. @@ -32,4 +32,4 @@ open http://localhost:1313 ## Customizing your page -There's a wide variety of customizations that you can make to your Hugo Fresh landing page by modifying the `config.yaml` file that you downloaded. That file provides documentation for what the various config values represent. \ No newline at end of file +There's a wide variety of customizations that you can make to your Hugo Fresh landing page by modifying the `config.yaml` file that you downloaded. That file provides documentation for what the various config values represent. diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index 89dba9c..50e2313 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -1,4 +1,38 @@ baseURL: http://something-fresh.org/ languageCode: en-us title: Hugo Fresh Theme -theme: hugo-fresh \ No newline at end of file +theme: hugo-fresh + +params: + hero: + # Main hero title + title: Manage. Deploy. + # Hero subtitle (optional) + subtitle: Lorem ipsum sit dolor amet is dummy text used by the typography industry + buttonText: Get started + buttonLink: "#" + # Hero image (from /images/___) + image: illustrations/worker.svg + # Footer logos (from /images/logos/clients/___.svg) + clientLogos: + - systek + - tribe + - kromo + - infinite + - gutwork + section1: + title: Great power comes + subtitle: with great responsibility + tiles: + - title: App builder + icon: mouse-globe + text: This is some explanatory text that is on two rows + buttonText: Free trial + - title: Cloud integration + icon: laptop-cloud + text: This is some explanatory text that is on two rows + buttonText: Get started + - title: Add-ons & plugins + icon: plug-cloud + text: This is some explanatory text that is on two rows + buttonText: Get started \ No newline at end of file diff --git a/fresh.png b/images/screenshot.png similarity index 100% rename from fresh.png rename to images/screenshot.png diff --git a/layouts/partials/hero-body.html b/layouts/partials/hero-body.html index 51e9851..18e3486 100644 --- a/layouts/partials/hero-body.html +++ b/layouts/partials/hero-body.html @@ -1,20 +1,30 @@ +{{- $hero := .Site.Params.hero }} +{{- $title := index $hero "title" }} +{{- $subtitle := index $hero "subtitle" }} +{{- $buttonText := index $hero "buttonText" }} +{{- $buttonLink := index $hero "buttonLink" }} +{{- $image := index $hero "image" }}

- Manage, Deploy. + {{ $title }}

-

Lorem ipsum sit dolor amet is a dummy text used by typography industry

+ {{ with $subtitle }} +

+ {{ . }} +

+ {{ end }}

- - Get Started + + {{ $buttonText }}

- Description + Description
diff --git a/layouts/partials/hero-footer.html b/layouts/partials/hero-footer.html index 69c7a0d..c43dc57 100644 --- a/layouts/partials/hero-footer.html +++ b/layouts/partials/hero-footer.html @@ -1,12 +1,16 @@ +{{- $hero := .Site.Params.hero }} +{{- $clientLogos := index $hero "clientLogos" }}
    -
  • -
  • -
  • -
  • -
  • + {{- range $clientLogos }} +
  • + + + +
  • + {{- end }}
diff --git a/layouts/partials/section1.html b/layouts/partials/section1.html index 3fbe8d1..02b34a2 100644 --- a/layouts/partials/section1.html +++ b/layouts/partials/section1.html @@ -1,62 +1,36 @@ +{{- $section1 := .Site.Params.section1 }} +{{- $title := index $section1 "title" }} +{{- $subtitle := index $section1 "subtitle" }} +{{- $tiles := index $section1 "tiles" }}
-
-
-

Great Power Comes

-

With great Responsability

-
-
- -
-
-
-
-
-

App builder

-
-
- -
-
-

This is some explanatory text that is on two rows

-
- -
-
-
-
-
-

Cloud integration

-
-
- -
-
-

This is some explanatory text that is on two rows

-
- -
-
-
-
-
-

Addons & Plugins

-
-
- -
-
-

This is some explanatory text that is on two rows

-
- -
-
-
-
+
+
+

{{ $title }}

+

{{ $subtitle }}

+
+ +
+
+ {{- range $tiles }} +
+
+
+

{{ .title }}

+
+
+ +
+
+

{{ .text }}

+
+ +
+
+ {{- end }} +
+
+
\ No newline at end of file