Make sidebar optional, make it possible to overide all parmas per post.
This commit is contained in:
parent
10d36011ee
commit
0299c650d5
3 changed files with 27 additions and 68 deletions
|
|
@ -7,14 +7,14 @@
|
|||
{{ block "meta" . }}{{ end }}
|
||||
</head>
|
||||
|
||||
<body class="one-sidebar sidebar-second">
|
||||
<body class="{{ if $.Param "sidebar" | default true }}one-sidebar sidebar-second{{ else }}no-sidebars{{ end }}">
|
||||
<div class="layout-center">
|
||||
<header class="header" role="banner">
|
||||
<a href="{{ .Site.BaseURL }}" title="Home" rel="home" class="header__logo"><img src="/images/logo.png" alt="Home" class="header__logo-image" /></a>
|
||||
{{ if $.Param "logo" | default true }}<a href="{{ .Site.BaseURL }}" title="Home" rel="home" class="header__logo"><img src="/images/logo.png" alt="Home" class="header__logo-image" /></a>{{ end }}
|
||||
<h1 class="header__site-name">
|
||||
<a href="{{ .Site.BaseURL }}" title="Home" class="header__site-link" rel="home"><span>{{ .Site.Title }}</span></a>
|
||||
</h1>
|
||||
<div class="header__region region region-header">{{ if .Site.Params.search }}{{ partialCached "search.html" . }}{{ end }}</div>
|
||||
<div class="header__region region region-header">{{ if $.Param "search" }}{{ partialCached "search.html" . }}{{ end }}</div>
|
||||
</header>
|
||||
|
||||
<div class="layout-3col layout-swap">
|
||||
|
|
@ -22,9 +22,9 @@
|
|||
</div>
|
||||
|
||||
<footer class="footer" role="contentinfo">
|
||||
<p>{{ with .Site.Params.copyright }}{{ . | markdownify }}{{ else }}<span>© {{ .Site.Title }}</span>{{ end }}</p>
|
||||
{{ with .Site.Params.footer }}<p>{{ . | markdownify }}</p>{{ end }}
|
||||
{{ if .Site.Params.poweredby }}<p>Powered by <a href="https://gohugo.io/">Hugo</a></p>{{ end }}
|
||||
<p>{{ with $.Param "copyright" }}{{ . | markdownify }}{{ else }}<span>© {{ .Site.Title }}</span>{{ end }}</p>
|
||||
{{ with $.Param "footer" }}<p>{{ . | markdownify }}</p>{{ end }}
|
||||
{{ if $.Param "poweredby" }}<p>Powered by <a href="https://gohugo.io/">Hugo</a></p>{{ end }}
|
||||
</footer>
|
||||
</div>
|
||||
{{ partialCached "scripts.html" . }}
|
||||
|
|
|
|||
|
|
@ -5,20 +5,15 @@
|
|||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<main class="layout-3col__left-content" role="main">
|
||||
{{ range .Data.Pages }}
|
||||
<article class="{{ with .Section }}section-{{ . | urlize }}{{ end }} list-view">
|
||||
<header>
|
||||
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a><h2>
|
||||
</header>
|
||||
<div>
|
||||
{{ .Summary }}
|
||||
</div>
|
||||
</article>
|
||||
<main class="{{ if $.Param "sidebar" | default true }}layout-3col__left-content{{ else }}layout-3col__full{{ end }}" role="main">
|
||||
{{ $paginator := .Paginate (.Data.Pages) }}
|
||||
{{ range $paginator.Pages }}
|
||||
{{ .Render "summary"}}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "pagination.html" . }}
|
||||
</main>
|
||||
|
||||
{{ partial "menu.html" . }}
|
||||
{{ partial "sidebar.html" . }}
|
||||
|
||||
{{ if $.Param "sidebar" | default true }}{{ partial "sidebar.html" . }}{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,10 @@
|
|||
|
||||
{{ define "meta" }}
|
||||
{{ partial "single_meta.html" . }}
|
||||
{{ partial "single_json_ld.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<main class="layout-3col__left-content" role="main">
|
||||
<main class="{{ if $.Param "sidebar" | default true }}layout-3col__left-content{{ else }}layout-3col__full{{ end }}" role="main">
|
||||
<h1>{{ .Title }}</h1>
|
||||
<article class="{{ with .Section }}section-{{ . | urlize }}{{ end }} single-view">
|
||||
<header>
|
||||
|
|
@ -18,5 +17,5 @@
|
|||
</main>
|
||||
|
||||
{{ partial "menu.html" . }}
|
||||
{{ partial "sidebar.html" . }}
|
||||
{{ if $.Param "sidebar" | default true }}{{ partial "sidebar.html" . }}{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
|||
Loading…
Reference in a new issue