From e4819358a33461e8caa00f7e3514d4ba00b535d5 Mon Sep 17 00:00:00 2001 From: Robert Austin Date: Fri, 15 Mar 2019 11:24:59 +1000 Subject: [PATCH] homepage defaults and config params from site --- exampleSite/config.toml | 4 ++++ exampleSite/content/_index.md | 3 --- layouts/index.html | 12 ++++++------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 119a1ef..9b29af3 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -21,6 +21,10 @@ pygmentsUseClasses = true [params] google_analytics_id="" mainSections = ["docs"] + homepage_button_link = '/docs' + homeoage_button_text = 'Read The Docs' + homepage_intro = 'Whisper is a documentation theme built with Hugo. The design and functionality is intentionally minimal.' + homepage_image = '/images/terminal.gif' [params.homepage_meta_tags] meta_description = "Hugo Whisper is a documentation theme built with Hugo." diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index adcac50..f4da22f 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -1,9 +1,6 @@ --- 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 def61c9..41e42bb 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -20,25 +20,25 @@
-

{{ .Title }}

+

{{ .Title | default .Site.Title }}

- {{ .Content }} + {{ .Content | default .Site.Params.homepage_intro }}
- - {{ .Page.Params.button_text }} + + {{ .Site.Params.homeoage_button_text }}
-{{ if .Page.Params.image }} +{{ if .Site.Params.homepage_image }}
- +