mirror of https://github.com/docker/docs.git
hugo: fix edge case causing duplicate h1 (#17959)
Some documents are missing a `title` front matter, and instead use an H1 from the document body. This change introduces a fix to render an external h1 only if the front matter field is set. Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
c6667b7acb
commit
1c6f0ee337
|
@ -5,7 +5,9 @@
|
|||
{{ define "main" }}
|
||||
{{ partial "breadcrumbs-legacy.html" . }}
|
||||
<article class="prose max-w-none dark:prose-invert">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ with .Title }}
|
||||
<h1>{{ . }}</h1>
|
||||
{{ end }}
|
||||
{{ .Content }}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
{{ define "main" }}
|
||||
{{ partial "breadcrumbs-legacy.html" . }}
|
||||
<article class="prose max-w-none dark:prose-invert">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ with .Title }}
|
||||
<h1>{{ . }}</h1>
|
||||
{{ end }}
|
||||
{{ .Content }}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in New Issue