mirror of
https://github.com/davegallant/davegallant.github.io.git
synced 2025-08-08 01:22:29 +00:00
Switch to theme based on Archie
This commit is contained in:
15
themes/archie/layouts/partials/comments.html
Normal file
15
themes/archie/layouts/partials/comments.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{- $config := .Site.Params.comments -}}
|
||||
|
||||
{{- $utterancesEnabled := $config.utterances.enable -}}
|
||||
|
||||
{{- if and ( $utterancesEnabled ) ( not .Params.disable_comments) -}}
|
||||
<section id='comments' class='comments'>
|
||||
<div class='container sep-before'>
|
||||
<div class='comments-area'>
|
||||
{{- if $utterancesEnabled -}}
|
||||
{{ partial "comments/utterances" . }}
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{- end -}}
|
19
themes/archie/layouts/partials/comments/utterances.html
Normal file
19
themes/archie/layouts/partials/comments/utterances.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{{- $scriptSrc := "https://utteranc.es/client.js" -}}
|
||||
|
||||
{{- $issueTerm := .Page.Site.Params.comments.utterances.issueTerm -}}
|
||||
{{- $label := .Page.Site.Params.comments.utterances.label -}}
|
||||
{{- $theme := .Page.Site.Params.comments.utterances.theme -}}
|
||||
{{- $username := .Page.Site.Params.comments.utterances.github.username -}}
|
||||
{{- $repository := .Page.Site.Params.comments.utterances.github.repository -}}
|
||||
|
||||
<script src='{{ $scriptSrc }}'
|
||||
repo='{{ print $username "/" $repository }}'
|
||||
issue-term='{{ $issueTerm }}'
|
||||
{{ if $label -}}
|
||||
label='{{ $label }}'
|
||||
{{- end }}
|
||||
{{ if $theme -}}
|
||||
theme='{{ $theme }}'
|
||||
{{- end }}
|
||||
crossorigin='anonymous' async>
|
||||
</script>
|
21
themes/archie/layouts/partials/footer.html
Normal file
21
themes/archie/layouts/partials/footer.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<footer>
|
||||
<div style="display:flex">
|
||||
{{- range $index, $key := .Site.Params.Social -}}
|
||||
<a class="soc" href="{{ $key.url }}" rel="me" title="{{ $key.name }}"><i data-feather="{{ $key.icon }}"></i></a>
|
||||
<a class="border"></a>
|
||||
{{- end -}}
|
||||
</div>
|
||||
<div class="footer-info">
|
||||
{{ dateFormat "2006" now }} {{ with .Site.Copyright }} {{ . }} | {{ end }} Theme based on <a
|
||||
href="https://github.com/athul/archie">Archie</a> | Built with <a href="https://gohugo.io">Hugo</a>
|
||||
</div>
|
||||
</footer>
|
||||
{{ if not .Site.IsServer }}
|
||||
{{ template "_internal/google_analytics_async.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{- if (isset .Site.Params "social") -}}
|
||||
<script>
|
||||
feather.replace()
|
||||
</script>
|
||||
{{- end -}}
|
14
themes/archie/layouts/partials/head.html
Normal file
14
themes/archie/layouts/partials/head.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<header>
|
||||
<div class="main">
|
||||
<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||
</div>
|
||||
<nav>
|
||||
{{ range .Site.Menus.main }}
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
{{ if eq .Site.Params.mode "toggle" -}}
|
||||
| <span id="dark-mode-toggle" onclick="toggleTheme()"></span>
|
||||
<script src="{{ .Site.BaseURL }}js/themetoggle.js"></script>
|
||||
{{ end }}
|
||||
</nav>
|
||||
</header>
|
104
themes/archie/layouts/partials/header.html
Normal file
104
themes/archie/layouts/partials/header.html
Normal file
@@ -0,0 +1,104 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
{{- $title := ( .Title ) -}}
|
||||
{{- $siteTitle := ( .Site.Title ) -}}
|
||||
{{- if .IsHome -}}
|
||||
<title>{{ $siteTitle }} | Home </title>
|
||||
{{- else -}}
|
||||
<title>{{ $title }} - {{ $siteTitle }}</title>
|
||||
{{- end -}}
|
||||
|
||||
{{- if isset .Site.Params "favicon" -}}
|
||||
<link rel="icon" type="image/png" href={{ .Site.Params.favicon }} />
|
||||
{{- end -}}
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
|
||||
<meta property="og:image" content="{{ .Site.Params.og_image }}"/>
|
||||
{{ with .OutputFormats.Get "rss" -}}
|
||||
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
|
||||
{{ end -}}
|
||||
|
||||
{{- template "_internal/opengraph.html" . -}}
|
||||
{{- template "_internal/twitter_cards.html" . -}}
|
||||
{{ if and (isset .Site.Params "social") (.Site.Params.useCDN | default false) -}}
|
||||
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
||||
{{- else if or (isset .Site.Params "social") (eq .Site.Params.mode "toggle") -}}
|
||||
<script src="{{ .Site.BaseURL }}js/feather.min.js"></script>
|
||||
{{ end }}
|
||||
{{ if .Site.Params.useCDN | default false -}}
|
||||
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@1,500&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Fira+Sans&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
|
||||
{{- else -}}
|
||||
{{ $fontstyle := resources.Get "css/fonts.css" | fingerprint }}
|
||||
<link href="{{ $fontstyle.Permalink }}" rel="stylesheet">
|
||||
{{ end }}
|
||||
|
||||
{{ $style := resources.Get "css/main.css" | fingerprint }}
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="{{ $style.Permalink }}" />
|
||||
|
||||
{{- if or (eq .Site.Params.mode "auto") (eq .Site.Params.mode "dark") (eq .Site.Params.mode "toggle") -}}
|
||||
{{ $darkstyle := resources.Get "css/dark.css" | fingerprint }}
|
||||
<link id="darkModeStyle" rel="stylesheet" type="text/css" href="{{ $darkstyle.Permalink }}" {{ if eq .Site.Params.mode "auto" }}media="(prefers-color-scheme: dark)"{{ end }} {{ if eq .Site.Params.mode "toggle" }}disabled{{ end }} />
|
||||
{{ end }}
|
||||
|
||||
<!-- Mathjax support -->
|
||||
{{ with .Site.Params.mathjax }}
|
||||
<script type="text/javascript"
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
|
||||
</script>
|
||||
|
||||
<!-- inline Mathjax -->
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
tex2jax: {
|
||||
inlineMath: [['$','$'], ['\\(','\\)']],
|
||||
displayMath: [['$$','$$'], ['\[','\]']],
|
||||
processEscapes: true,
|
||||
processEnvironments: true,
|
||||
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
|
||||
TeX: { equationNumbers: { autoNumber: "AMS" },
|
||||
extensions: ["AMSmath.js", "AMSsymbols.js"] }
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
<!-- KaTeX support -->
|
||||
{{ with .Site.Params.katex }}
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.css">
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/katex.min.js"></script>
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.15.2/dist/contrib/auto-render.min.js" onload="renderMathInElement(document.body);"></script>
|
||||
|
||||
<!-- inline KaTeX -->
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
renderMathInElement(document.body, {
|
||||
delimiters: [
|
||||
{left: "$$", right: "$$", display: true},
|
||||
{left: "$", right: "$", display: false}
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
<!-- Custom CSS style get applied last -->
|
||||
{{- if isset .Site.Params "customcss" }}
|
||||
{{ range .Site.Params.customCSS }}
|
||||
{{ $customstyle := resources.Get . | fingerprint }}
|
||||
<link rel="stylesheet" type="text/css" href="{{ $customstyle.Permalink }}">
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
{{- range .Site.Params.customJS }}
|
||||
{{- if or (hasPrefix . "http://") (hasPrefix . "https://") }}
|
||||
<script src="{{ . }}"></script>
|
||||
{{- else if (hasPrefix . "<script")}}
|
||||
{{ .| safeHTML }}
|
||||
{{- else }}
|
||||
<script src="{{ $.Site.BaseURL }}{{ . }}"></script>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</head>
|
7
themes/archie/layouts/partials/pagedescription.html
Normal file
7
themes/archie/layouts/partials/pagedescription.html
Normal file
@@ -0,0 +1,7 @@
|
||||
<div class="description">
|
||||
{{ if isset .Params "description" }}
|
||||
{{ .Description }}
|
||||
{{ else }}
|
||||
{{ .Summary }}…
|
||||
{{ end }}
|
||||
</div>
|
15
themes/archie/layouts/partials/paginator.html
Normal file
15
themes/archie/layouts/partials/paginator.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{ $pag := $.Paginator }}
|
||||
{{ if gt $pag.TotalPages 1 }}
|
||||
<ul class="pagination">
|
||||
<span class="page-item page-prev">
|
||||
{{ if $pag.HasPrev }}
|
||||
<a {{ if $pag.HasPrev }}href="{{ $pag.Prev.URL }}"{{ end }} class="page-link" aria-label="Previous"><span aria-hidden="true">← Prev</span></a>
|
||||
{{ end }}
|
||||
</span>
|
||||
<span class="page-item page-next">
|
||||
{{ if $pag.HasNext }}
|
||||
<a {{ if $pag.HasNext }}href="{{ $pag.Next.URL }}"{{ end }} class="page-link" aria-label="Next"><span aria-hidden="true">Next →</span></a>
|
||||
{{ end }}
|
||||
</span>
|
||||
</ul>
|
||||
{{ end }}
|
Reference in New Issue
Block a user