baseof: separate into header, footer

This commit is contained in:
Aditya Telange 2020-07-21 15:36:30 +05:30
parent 118bf1345e
commit 28aa04ddb6
3 changed files with 42 additions and 38 deletions

View File

@ -6,28 +6,12 @@
</head>
<body class="{{ if eq .Kind `page` }}single{{ else }}list{{ if .IsHome }} home{{ end }}{{ end }}">
{{- if $.Site.Params.SetThemeAuto -}}
<script>
setTheme();
</script>
{{- end -}}
<header class="header">
{{- partial "header.html" . }}
</header>
{{- partial "header.html" . }}
<main class="main">
{{- block "main" . }}
{{end }}
</main>
<footer class="footer">
{{- partial "footer.html" . }}
</footer>
{{ $highlight := resources.Get "js/highlight.min.js" | minify | fingerprint}}
<script src="{{ $highlight.Permalink }}" integrity="{{ $highlight.Data.Integrity }}"></script>
<script>
hljs.initHighlightingOnLoad();
</script>
{{- partial "footer.html" . }}
</body>
</html>

View File

@ -1,5 +1,13 @@
<span>&copy; {{ now.Year }} <a href="{{ "" | absURL }}">{{ .Site.Title }}</a></span>
<span>&middot;</span>
<span>Powered by <a href="https://gohugo.io/" rel="noopener" target="_blank">Hugo</a></span>
<span>&middot;</span>
<span>Theme <a href="https://github.com/adityatelange/hugo-PaperMod" rel="noopener" target="_blank">PaperMod</a></span>
<footer class="footer">
<span>&copy; {{ now.Year }} <a href="{{ "" | absURL }}">{{ .Site.Title }}</a></span>
<span>&middot;</span>
<span>Powered by <a href="https://gohugo.io/" rel="noopener" target="_blank">Hugo</a></span>
<span>&middot;</span>
<span>Theme <a href="https://github.com/adityatelange/hugo-PaperMod" rel="noopener"
target="_blank">PaperMod</a></span>
</footer>
{{ $highlight := resources.Get "js/highlight.min.js" | minify | fingerprint}}
<script src="{{ $highlight.Permalink }}" integrity="{{ $highlight.Data.Integrity }}"></script>
<script>
hljs.initHighlightingOnLoad();
</script>

View File

@ -1,16 +1,28 @@
<nav class="nav">
{{- if .IsHome }}
<h1 class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></h1>
{{- else }}
<p class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></p>
{{- end }}
{{- if .Site.Menus.main }}
<ul class="menu">
{{- range .Site.Menus.main }}
<li>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{- if $.Site.Params.SetThemeAuto -}}
<script>
setTheme();
</script>
{{- end -}}
<header class="header">
{{- if $.Site.Params.SetThemeAuto -}}
<script>
setTheme();
</script>
{{- end -}}
<nav class="nav">
{{- if .IsHome }}
<h1 class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></h1>
{{- else }}
<p class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></p>
{{- end }}
</ul>
{{- end }}
</nav>
{{- if .Site.Menus.main }}
<ul class="menu">
{{- range .Site.Menus.main }}
<li>
<a href="{{ .URL }}">{{ .Name }}</a>
</li>
{{- end }}
</ul>
{{- end }}
</nav>
</header>