hugo-scroll/layouts/_default/single.html
Daniel Holbach 811e1f2b54 Fix language menu in multihost setting
#196 added the flexibility to index.html to be used in subdirectories.

	Unfortunately this broke the language menu in multihost settings.
	Both functionalities are made to work now by checking the
	`hugo.IsMultihost` condition.

	This makes the code somewhat harder to read, but at least ensures
	that the regression is fixed.

	Fixes: #214

Signed-off-by: Daniel Holbach <daniel.holbach@gmail.com>
2025-03-27 22:21:07 +01:00

19 lines
762 B
HTML

{{ define "main" }}
<main class="content page-template page-{{ .Slug }}">
<article class="post page">
<header class="post-header">
{{ with .Parent }}
{{ if hugo.IsMultihost }}
<a id="back-to-main-page" href="{{ .RelPermalink | relLangURL }}"><i class="fa fa-chevron-left" aria-hidden="true"></i> {{ or .Title .Site.Title }}</a>
{{ else }}
<a id="back-to-main-page" href="{{ .RelPermalink | relLangURL }}"><i class="fa fa-chevron-left" aria-hidden="true"></i> {{ or .Title .Site.Title }}</a>
{{ end }}
{{ end }}
</header>
<h1 class="post-title">{{ .Title }}</h1>
<section class="post-content">
{{ .Content }}
</section>
</article>
</main>
{{ end }}