Add safeHTML to blog-title

SafeHTML signals to the go templating engine that the html in this string is considered safe and does not need to be escaped. This will allow me to add some additional markup to the title. In my case, I use an explicit <br/> tag to control the line break.
This commit is contained in:
Sylvia Dieckmann 2022-06-15 09:44:46 +02:00 committed by GitHub
parent 1d92c6b79b
commit 6ac16b42d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,7 @@
<div class="vertical"> <div class="vertical">
<div id="site-head-content" class="inner"> <div id="site-head-content" class="inner">
{{ with .Params.header_headline }}<h1 class="blog-title">{{ . }}</h1>{{ end }} {{ with .Params.header_headline }}<h1 class="blog-title">{{ . | safeHTML }}</h1>{{ end }}
{{ with .Params.header_subheadline }}<h2 class="blog-description">{{ . }}</h2>{{ end }} {{ with .Params.header_subheadline }}<h2 class="blog-description">{{ . }}</h2>{{ end }}
{{ range where $sections ".Params.header_menu" "eq" true }} {{ range where $sections ".Params.header_menu" "eq" true }}