mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
ac78d25240
Enclose `{{ .Content }}` with a `{{ if .IsPage }}` test to avoid the "Content is not a field of struct type *hugolib.Node" error. Thanks to @spf13 for the tip! Fixes #366. Also update example to Hugo v0.12 conventions: - Convert config.yaml to config.toml to follow what `hugo new site /path/to/site` generates - Rename layouts/chrome to layouts/partials - Convert `template` calls to `partial` calls - Add .gitignore to ignore the `public` directory - Add README.md with pointers to discussions in issues to help bring newcomers up to speed with this multilingual example
25 lines
580 B
HTML
25 lines
580 B
HTML
<header>
|
|
<nav class="menu language-menu">
|
|
<ul>
|
|
<li><a href="/">English</a></li>
|
|
<li><a href="/kodu">Eesti</a></li>
|
|
</ul>
|
|
<div class="clear"></div>
|
|
</nav>
|
|
|
|
{{ if (eq .Params.lang "et") }}
|
|
<h1 class="title">Minu mitmekeelne leht</h1>
|
|
{{ else }}
|
|
<h1 class="title">My multilingual site</h1>
|
|
{{ end }}
|
|
|
|
<nav class="menu main-menu">
|
|
<ul>
|
|
{{ range (index .Site.Indexes.menu .Params.lang).Pages }}
|
|
<li><a href="{{ .Permalink }}">{{ .LinkTitle }}</a></li>
|
|
{{ end }}
|
|
</ul>
|
|
</nav>
|
|
</header>
|
|
|
|
<h2 class="subtitle">{{ .Title }}</h2>
|