From e418548683db5eb3eff98fc073789932f9a353b1 Mon Sep 17 00:00:00 2001
From: Sean Harger <seanharger93@gmail.com>
Date: Mon, 11 Feb 2019 03:47:28 +0000
Subject: [PATCH] Support hiding the featured image header text. (#155)
---
layouts/partials/page-header.html | 12 +++++++-----
exampleSite/static/images/notebook.jpg | 0
exampleSite/content/contact.md | 2 ++
README.md | 2 ++
4 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 2419d6a..4e58cd8 100644
--- a/README.md
+++ b/README.md
@@ -78,6 +78,8 @@
For any page or post you can add a featured image by including the local path in front matter (see content in the `exampleSite/content/_readme.md` file for examples): `featured_image: '/images/gohugo-default-sample-hero-image.jpg'`
+If you would like to hide the header text on the featured image on a page, set `omit_header_text` to `true`. See `exampleSite/content/contact.md` for an example.
+
You don't need an image though. The default background color is black, but you can change the color, by changing the default color class in the config.toml file. Choose a background color from any on the [Tachyons](http://tachyons.io/docs/themes/skins/) library site, and preface it with "bg-"
example: `background_color_class = "bg-blue"` or `background_color_class = "bg-gray"`
diff --git a/exampleSite/content/contact.md b/exampleSite/content/contact.md
index 2bea23d..d02ba18 100644
--- a/exampleSite/content/contact.md
+++ b/exampleSite/content/contact.md
@@ -1,5 +1,7 @@
---
title: Contact
+featured_image: "images/notebook.jpg"
+omit_header_text: true
description: We'd love to hear from you
type: page
menu:
diff --git a/exampleSite/static/images/notebook.jpg b/exampleSite/static/images/notebook.jpg
new file mode 100644
index 0000000..934af26
--- /dev/null
+++ b/exampleSite/static/images/notebook.jpg
Binary files differ
diff --git a/layouts/partials/page-header.html b/layouts/partials/page-header.html
index 6d638d2..8cd6d4f 100644
--- a/layouts/partials/page-header.html
+++ b/layouts/partials/page-header.html
@@ -6,11 +6,13 @@
<div class="pb3-m pb6-l bg-black-60">
{{ partial "site-navigation.html" . }}
<div class="tc-l pv6 ph3 ph4-ns">
- <h1 class="f2 f1-l fw2 white-90 mb0 lh-title">{{ .Title | default .Site.Title }}</h1>
- {{ with .Params.description }}
- <h2 class="fw1 f5 f3-l white-80 measure-wide-l center lh-copy mt3 mb4">
- {{ . }}
- </h2>
+ {{ if not .Params.omit_header_text }}
+ <h1 class="f2 f1-l fw2 white-90 mb0 lh-title">{{ .Title | default .Site.Title }}</h1>
+ {{ with .Params.description }}
+ <h2 class="fw1 f5 f3-l white-80 measure-wide-l center lh-copy mt3 mb4">
+ {{ . }}
+ </h2>
+ {{ end }}
{{ end }}
</div>
</div>
--
Gitblit v1.10.0