diff options
author | Robert Austin <rob@jugglerdigital.com> | 2019-03-14 04:23:20 +0300 |
---|---|---|
committer | Robert Austin <rob@jugglerdigital.com> | 2019-03-14 04:23:20 +0300 |
commit | 400c232f1644ff5fb2c8628235ecc9fa64b12307 (patch) | |
tree | b4fc1524d13d17e1c5d63bdadbfc9d651cd3ed1e | |
parent | 153157092da2079d2282127ce9842e2a4b3157ba (diff) |
make homepage button and image editable from frontmatter
-rw-r--r-- | exampleSite/content/_index.md | 3 | ||||
-rw-r--r-- | layouts/index.html | 12 |
2 files changed, 11 insertions, 4 deletions
diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index f4da22f..adcac50 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -1,6 +1,9 @@ --- title: 'Hugo Whisper Docs' date: 2018-11-28T15:14:39+10:00 +button_link: '/docs' +button_text: 'Read The Docs' +image: '/images/terminal.gif' --- Whisper is a documentation theme built with Hugo. The design and functionality is intentionally minimal. diff --git a/layouts/index.html b/layouts/index.html index 806a899..def61c9 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,7 +1,7 @@ {{ define "title" }}Hugo Whisper Theme Demo{{ end}} {{ define "header_css" }}{{ end }} {{ define "body_classes" }}page-home{{ end }} -{{ define "header_classes" }}header-transparent{{ end }} +{{ define "header_classes" }}{{ end }} {{ define "meta_tags" }} <meta name="description" content="{{ .Site.Params.homepage_meta_tags.meta_description }}" /> @@ -24,24 +24,28 @@ <div class="content"> {{ .Content }} </div> - <a class="button button-primary mb-2" href="{{ "docs" | absURL }}">Read The Docs</a> + <a class="button button-primary mb-2" href="{{ .Page.Params.button_link | relURL }}"> + {{ .Page.Params.button_text }} + </a> </div> </div> </div> </div> +{{ if .Page.Params.image }} <div class="strip"> <div class="container pt-4 pb-4"> <div class="row justify-content-center"> <div class="col-12 col-md-10"> <div class="terminal"> - <img src="{{ "images/terminal.gif" | absURL}}" /> + <img src="{{ .Page.Params.image | absURL}}" /> </div> </div> </div> </div> </div> -</div> +{{ end }} + {{ end }} {{ define "footer_js" }} |