summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-07-21 15:36:30 +0530
committerAditya Telange <21258296+adityatelange@users.noreply.github.com>2020-07-21 15:36:30 +0530
commit28aa04ddb662bce5f9cabd43985419b9a12cd40c (patch)
tree007fd372d0aa5dd73060996f2a6c7a894d1369a7
parent118bf1345e7756a1739d0f52d21f9600accf5698 (diff)
baseof: separate into header, footer
-rw-r--r--layouts/_default/baseof.html20
-rw-r--r--layouts/partials/footer.html18
-rw-r--r--layouts/partials/header.html42
3 files changed, 42 insertions, 38 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 6784f2b..9610585 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -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> \ No newline at end of file
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 1062c07..38f6d30 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -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> \ No newline at end of file
+<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> \ No newline at end of file
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index c1cc59e..a72672a 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -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> \ No newline at end of file
+ {{- if .Site.Menus.main }}
+ <ul class="menu">
+ {{- range .Site.Menus.main }}
+ <li>
+ <a href="{{ .URL }}">{{ .Name }}</a>
+ </li>
+ {{- end }}
+ </ul>
+ {{- end }}
+ </nav>
+</header> \ No newline at end of file