This is an automated email from the ASF dual-hosted git repository.
zregvart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-website.git
The following commit(s) were added to refs/heads/master by this push:
new 4167304 fix: make sure we don't output empty h1 tags
4167304 is described below
commit 4167304b0bbaa924e6f59b09dcadb4c951bfc40f
Author: Zoran Regvart <[email protected]>
AuthorDate: Sat Jun 27 22:57:36 2020 +0200
fix: make sure we don't output empty h1 tags
For #397 we didn't want to have a title, so we ended up rendering an
empty h1 tag, this makes sure that the h1 tag is rendered only if the
title is provided in the front matter.
---
layouts/_default/section.html | 6 ++++--
layouts/_default/single.html | 4 +++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/layouts/_default/section.html b/layouts/_default/section.html
index 7861680..4cab5f2 100644
--- a/layouts/_default/section.html
+++ b/layouts/_default/section.html
@@ -1,8 +1,10 @@
{{ partial "header.html" . }}
- <article class="static doc {{ .Page.Section }}">
+ <article class="static doc {{ .Page.Section }}">
- <h1>{{ .Title }} </h1>
+ {{ with .Title }}
+ <h1>{{ . }} </h1>
+ {{ end }}
{{ .Content }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 1ddb38a..3065ce7 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -4,7 +4,9 @@
<main role="main">
<article class="static doc {{ .Page.Section }}">
- <h1>{{ .Title }}</h1>
+ {{ with .Title }}
+ <h1>{{ . }} </h1>
+ {{ end }}
{{ .Content }}