new layout
- create baseof - separate list, single - header, footer
This commit is contained in:
parent
2e0ef75edf
commit
8a0783adfb
|
@ -0,0 +1,31 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="{{ .Site.LanguageCode }}">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
{{- partial "head.html" . }}
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="{{ if eq .Kind `page` }}single{{ else }}list{{ if .IsHome }} home{{ end }}{{ end }}">
|
||||||
|
<script>
|
||||||
|
setTheme();
|
||||||
|
</script>
|
||||||
|
<header class="header">
|
||||||
|
{{- partial "header.html" . }}
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<main class="main">
|
||||||
|
{{- block "main" . }}
|
||||||
|
{{end }}
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<footer class="footer">
|
||||||
|
{{- partial "footer.html" . }}
|
||||||
|
</footer>
|
||||||
|
{{ $highlight := resources.Get "highlight.min.js" | minify }}
|
||||||
|
<script src="{{ $highlight.Permalink }}"></script>
|
||||||
|
<script>
|
||||||
|
hljs.initHighlightingOnLoad();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
|
@ -1,4 +1,4 @@
|
||||||
{{- partial "header.html" . }}
|
{{ define "main" }}
|
||||||
|
|
||||||
{{- $scope := .Site }}
|
{{- $scope := .Site }}
|
||||||
|
|
||||||
|
@ -39,4 +39,4 @@
|
||||||
</footer>
|
</footer>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- partial "footer.html" . }}
|
{{ end }}{{/* end main */}}
|
|
@ -1,4 +1,4 @@
|
||||||
{{- partial "header.html" . }}
|
{{ define "main" }}
|
||||||
|
|
||||||
<article class="post-single">
|
<article class="post-single">
|
||||||
<header class="post-header">
|
<header class="post-header">
|
||||||
|
@ -26,4 +26,4 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
{{- partial "footer.html" . }}
|
{{ end }}{{/* end main */}}
|
|
@ -1,16 +1,5 @@
|
||||||
</main>
|
<span>© {{ now.Year }} <a href="{{ "" | absURL }}">{{ .Site.Title }}</a></span>
|
||||||
<footer class="footer">
|
<span>·</span>
|
||||||
<span>© {{ now.Year }} <a href="{{ "" | absURL }}">{{ .Site.Title }}</a></span>
|
<span>Powered by <a href="https://gohugo.io/" rel="noopener" target="_blank">Hugo️️</a>️</span>
|
||||||
<span>·</span>
|
<span>·</span>
|
||||||
<span>Powered by <a href="https://gohugo.io/" rel="noopener" target="_blank">Hugo️️</a>️</span>
|
<span>Theme️ <a href="https://github.com/nanxiaobei/hugo-paper" rel="noopener" target="_blank">Paper</a></span>
|
||||||
<span>·</span>
|
|
||||||
<span>Theme️ <a href="https://github.com/nanxiaobei/hugo-paper" rel="noopener" target="_blank">Paper</a></span>
|
|
||||||
</footer>
|
|
||||||
{{ $highlight := resources.Get "highlight.min.js" | minify }}
|
|
||||||
<script src="{{ $highlight.Permalink }}"></script>
|
|
||||||
<script>
|
|
||||||
hljs.initHighlightingOnLoad();
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
|
@ -1,30 +1,16 @@
|
||||||
<!DOCTYPE html>
|
<nav class="nav">
|
||||||
<html lang="{{ .Site.LanguageCode }}">
|
{{- if .IsHome }}
|
||||||
|
<h1 class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></h1>
|
||||||
<head>
|
{{- else }}
|
||||||
{{- partial "head.html" . }}
|
<p class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></p>
|
||||||
</head>
|
{{- end }}
|
||||||
|
{{- if .Site.Menus.main }}
|
||||||
<body class="{{ if eq .Kind `page` }}single{{ else }}list{{ if .IsHome }} home{{ end }}{{ end }}">
|
<ul class="menu">
|
||||||
<script>
|
{{- range .Site.Menus.main }}
|
||||||
setTheme();
|
<li>
|
||||||
</script>
|
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||||
<header class="header">
|
</li>
|
||||||
<nav class="nav">
|
{{- end }}
|
||||||
{{- if .IsHome }}
|
</ul>
|
||||||
<h1 class="logo"><a href="{{ "" | absURL }}">{{ .Site.Title }}</a></h1>
|
{{- end }}
|
||||||
{{- else }}
|
</nav>
|
||||||
<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>
|
|
||||||
{{- end }}
|
|
||||||
</ul>
|
|
||||||
{{- end }}
|
|
||||||
</nav>
|
|
||||||
</header>
|
|
||||||
<main class="main">
|
|
Loading…
Reference in New Issue