summaryrefslogtreecommitdiff
path: root/layouts/partials
diff options
context:
space:
mode:
authorMiqdd <ahmadmiqdad27@te.student.pens.ac.id>2024-01-22 06:39:54 +0700
committerMiqdd <ahmadmiqdad27@te.student.pens.ac.id>2024-01-22 06:39:54 +0700
commit04fdcac1dce2cc439dd8ad1b115507671040737e (patch)
treefca0e8fa90c182863adf6a2baedadf8ebb46a5f4 /layouts/partials
Publish
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/disqus.html19
-rw-r--r--layouts/partials/footer.html21
-rw-r--r--layouts/partials/head.html14
-rw-r--r--layouts/partials/header.html104
-rw-r--r--layouts/partials/pagedescription.html7
-rw-r--r--layouts/partials/paginator.html15
6 files changed, 180 insertions, 0 deletions
diff --git a/layouts/partials/disqus.html b/layouts/partials/disqus.html
new file mode 100644
index 0000000..11bd488
--- /dev/null
+++ b/layouts/partials/disqus.html
@@ -0,0 +1,19 @@
+<div id="disqus_thread"></div>
+<script type="text/javascript">
+ (function () {
+ // Don't ever inject Disqus on localhost--it creates unwanted
+ // discussions from 'localhost:1313' on your Disqus account...
+ if (window.location.hostname == "localhost")
+ return;
+
+ var dsq = document.createElement('script');
+ dsq.type = 'text/javascript';
+ dsq.async = true;
+ var disqus_shortname = '{{ .Site.DisqusShortname }}';
+ dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ })();
+</script>
+<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by
+ Disqus.</a></noscript>
+<a href="http://disqus.com/" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a> \ No newline at end of file
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
new file mode 100644
index 0000000..b453bff
--- /dev/null
+++ b/layouts/partials/footer.html
@@ -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 }} <a
+ href="https://github.com/athul/archie">Archie Theme</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 -}}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
new file mode 100644
index 0000000..30476c8
--- /dev/null
+++ b/layouts/partials/head.html
@@ -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>
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
new file mode 100644
index 0000000..ad3ae4c
--- /dev/null
+++ b/layouts/partials/header.html
@@ -0,0 +1,104 @@
+<head lang="{{ .Site.Language.Lang }}">
+ <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>
diff --git a/layouts/partials/pagedescription.html b/layouts/partials/pagedescription.html
new file mode 100644
index 0000000..d69bb9a
--- /dev/null
+++ b/layouts/partials/pagedescription.html
@@ -0,0 +1,7 @@
+<div class="description">
+ {{ if isset .Params "description" }}
+ {{ .Description }}
+ {{ else }}
+ {{ .Summary }}&hellip;
+ {{ end }}
+</div> \ No newline at end of file
diff --git a/layouts/partials/paginator.html b/layouts/partials/paginator.html
new file mode 100644
index 0000000..5acc06d
--- /dev/null
+++ b/layouts/partials/paginator.html
@@ -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 }}