diff options
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/footer.html | 5 | ||||
-rw-r--r-- | layouts/partials/head.html | 10 | ||||
-rw-r--r-- | layouts/partials/head/css.html | 11 | ||||
-rw-r--r-- | layouts/partials/head/js.html | 12 | ||||
-rw-r--r-- | layouts/partials/header.html | 20 | ||||
-rw-r--r-- | layouts/partials/math.html | 9 | ||||
-rw-r--r-- | layouts/partials/pagination-controls.html | 23 | ||||
-rw-r--r-- | layouts/partials/post-entry.html | 4 |
8 files changed, 94 insertions, 0 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html new file mode 100644 index 0000000..65f97aa --- /dev/null +++ b/layouts/partials/footer.html @@ -0,0 +1,5 @@ +<p>Powered by + <a href="https://gohugo.io/">Hugo</a> + {{/* and + <a href="https://github.com/tomfran/typo">tomfran/typo</a> */}} +</p>
\ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html new file mode 100644 index 0000000..a16d7ea --- /dev/null +++ b/layouts/partials/head.html @@ -0,0 +1,10 @@ +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width"> +<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title> +{{ partialCached "head/css.html" . }} +{{ partialCached "head/js.html" . }} + + +{{ if hugo.IsProduction }} +{{ template "_internal/google_analytics.html" . }} +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/head/css.html b/layouts/partials/head/css.html new file mode 100644 index 0000000..abca3b8 --- /dev/null +++ b/layouts/partials/head/css.html @@ -0,0 +1,11 @@ +{{- $CSS := slice +(resources.Get "css/reset.css") +(resources.Get "css/vars.css") +(resources.Get "css/utils.css") +(resources.Get "css/fonts.css") +(resources.Get "css/main.css") | +resources.Concat "assets/combined.css" | +minify | +fingerprint }} + +<link rel="stylesheet" href="{{ $CSS.RelPermalink }}" media="all">
\ No newline at end of file diff --git a/layouts/partials/head/js.html b/layouts/partials/head/js.html new file mode 100644 index 0000000..18fe842 --- /dev/null +++ b/layouts/partials/head/js.html @@ -0,0 +1,12 @@ +{{- with resources.Get "js/main.js" }} + {{- if eq hugo.Environment "development" }} + {{- with . | js.Build }} + <script src="{{ .RelPermalink }}"></script> + {{- end }} + {{- else }} + {{- $opts := dict "minify" true }} + {{- with . | js.Build $opts | fingerprint }} + <script src="{{ .RelPermalink }}" integrity="{{- .Data.Integrity }}" crossorigin="anonymous"></script> + {{- end }} + {{- end }} +{{- end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000..92da9a7 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,20 @@ +{{/* Header */}} + +<div class="header"> + <h1>{{ site.Title }}</h1> + + <div class="flex"> + {{ $currentPage := . }} + + {{ with site.Params.menu }} + {{ range . }} + <p class="small {{ if eq .url $currentPage.Path }} bold {{end}}"> + <a href="{{.url}}"> + /{{.name }} + </a> + </p> + {{ end }} + {{ end }} + + </div> +</div>
\ No newline at end of file diff --git a/layouts/partials/math.html b/layouts/partials/math.html new file mode 100644 index 0000000..59a0b2d --- /dev/null +++ b/layouts/partials/math.html @@ -0,0 +1,9 @@ +<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script> +<script> + MathJax = { + tex: { + displayMath: [['\\[', '\\]'], ['$$', '$$']], + inlineMath: [['\\[', '\\]'], ['$', '$']] + } + }; +</script>
\ No newline at end of file diff --git a/layouts/partials/pagination-controls.html b/layouts/partials/pagination-controls.html new file mode 100644 index 0000000..b26d609 --- /dev/null +++ b/layouts/partials/pagination-controls.html @@ -0,0 +1,23 @@ +{{ if gt .TotalPages 1 }} +<div class="pagination"> + <div class="pagination-control"> + {{ if .HasPrev }} + <a href="{{ .Prev.URL | absURL }}"> + prev + </a> + {{ end }} + </div> + <div class="page-number"> + <p> + {{ .PageNumber }}/{{ .TotalPages }} + </p> + </div> + <div class="pagination-control"> + {{ if .HasNext }} + <a href="{{ .Next.URL | absURL }}"> + next + </a> + {{ end }} + </div> +</div> +{{ end }}
\ No newline at end of file diff --git a/layouts/partials/post-entry.html b/layouts/partials/post-entry.html new file mode 100644 index 0000000..f3f2a23 --- /dev/null +++ b/layouts/partials/post-entry.html @@ -0,0 +1,4 @@ +<div class="post-line"> + <p class="post-date">{{ .Date.Format "2 Jan 2006" }} </p> + <p class="post-title"> <a href="{{ .RelPermalink }}">{{ .Title }}</a></p> +</div>
\ No newline at end of file |