aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/404.html17
-rw-r--r--layouts/_default/baseof.html29
-rw-r--r--layouts/_default/list.html27
-rw-r--r--layouts/_default/single.html44
-rw-r--r--layouts/index.html22
-rw-r--r--layouts/partials/footer/copyright.html15
-rw-r--r--layouts/partials/footer/index.html4
-rw-r--r--layouts/partials/footer/social.html16
-rw-r--r--layouts/partials/head/index.html2
-rw-r--r--layouts/partials/head/meta.html42
-rw-r--r--layouts/partials/head/styles.html22
-rw-r--r--layouts/partials/header/avatar.html17
-rw-r--r--layouts/partials/header/index.html8
-rw-r--r--layouts/partials/header/nav.html22
-rw-r--r--layouts/partials/header/theme-button.html47
-rw-r--r--layouts/partials/header/title.html8
-rw-r--r--layouts/partials/list/default.html33
-rw-r--r--layouts/partials/list/pagination.html23
-rw-r--r--layouts/partials/single/comments/disqus.html4
-rw-r--r--layouts/partials/single/comments/giscus.html22
-rw-r--r--layouts/partials/single/comments/index.html11
-rw-r--r--layouts/partials/single/table-of-contents.html6
-rw-r--r--layouts/partials/utils/icon.html7
-rw-r--r--layouts/shortcodes/alert.html73
-rw-r--r--layouts/shortcodes/details.html75
-rw-r--r--layouts/shortcodes/img.html35
-rw-r--r--layouts/shortcodes/task-list.html1
-rw-r--r--layouts/taxonomies/home.html32
28 files changed, 534 insertions, 130 deletions
diff --git a/layouts/404.html b/layouts/404.html
index d042ff8..6bed926 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -1,12 +1,13 @@
{{ define "main" }}
<article class="flex flex-col gap-3">
- <header>
- <h2 class="text-2xl font-extrabold text-gray-900">{{ .Title }}</h2>
- </header>
- <section class="content text-lg text-gray-800">
- Looks like you've followed a broken link or entered a URL that doesn't exist on this site.
- </section>
+ <header>
+ <h2 class="title-small">{{ i18n "404_title" }}</h2>
+ </header>
+
+ <section>
+ <p>{{ i18n "404_text" }}</p>
+ </section>
</article>
-
-{{ end }} \ No newline at end of file
+
+{{ end }}
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 69be8f7..aa39a42 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -1,13 +1,20 @@
<!DOCTYPE html>
-<html lang="{{ .Site.LanguageCode | default `en` }}" class="scroll-smooth">
- <head>
- {{- partial "head.html" . -}}
- </head>
- <body class="max-w-screen-md px-10 mx-auto">
- {{ partial "header.html" . }}
- <main id="content">
- {{- block "main" . }}{{- end }}
- </main>
- {{- partial "footer.html" . -}}
- </body>
+<html lang="{{ .Site.LanguageCode | default `en` }}" class="scroll-smooth dark">
+ <head>
+ {{- partial "head/index" . -}}
+ </head>
+
+ <body class="max-w-screen-md mx-auto px-2.5">
+ <div class="header">
+ {{ partial "header/index" . }}
+ {{ partial "header/theme-button" . }}
+ </div>
+
+ <main id="content">
+ {{- block "main" . -}}
+ {{- end }}
+ </main>
+
+ {{- partial "footer/index" . -}}
+ </body>
</html>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 577852f..d366d53 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -1,17 +1,30 @@
{{ define "main" }}
+
{{ $pages := .Pages }}
-{{ $paginator := .Paginate $pages }}
+{{ $paginator := .Paginate $pages }}
+
<div class="flex flex-col gap-1">
-<h1 class="text-2xl font-extrabold">{{ if .Params.header }}{{ .Params.header }}{{ else }}{{ .Title }}{{ end }}</h1>
-{{ if .Content }}<p class="content text-lg text-gray-900">{{ .Content }}</p>{{ end }}
+ <h1 class="text-2xl font-extrabold">
+ {{ if .Params.header }}
+ {{ .Params.header }}
+ {{ else }}
+ {{ .Title }}
+ {{ end }}
+ </h1>
+
+ {{ with .Content }}
+ {{ . }}
+ {{ end }}
</div>
-<section class="py-10 flex flex-col gap-10 ">
-{{ range $index, $pages := $paginator.Pages }}
+<section class="flex flex-col gap-10">
+ {{ range $index, $pages := $paginator.Pages }}
{{ partial "list/default" . }}
-{{ end }}
+ {{ end }}
</section>
-{{ partial "list/components/pagination" . }}
+{{ if gt $paginator.TotalPages 1 }}
+ {{ partial "list/pagination" . }}
+{{ end }}
{{ end }} \ No newline at end of file
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 13aa7d0..80c3bee 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -1,3 +1,43 @@
{{ define "main" }}
-{{ partial "single/default" . }}
-{{ end }} \ No newline at end of file
+
+<article class="flex flex-col gap-10">
+ <header class="flex flex-col gap-2">
+ <h2 class="title-large">{{ .Title }}</h2>
+
+ <div class="meta">
+ {{/* Publish date */}}
+ <time datetime="{{ .PublishDate }}" title='{{ .PublishDate.Format "Mon, Jan 2, 2006, 3:04 PM MST" }}'>
+ {{ .PublishDate.Format "02/01/2006" }} - {{ printf (i18n "estimatedReadingTime") .ReadingTime }}
+ </time>
+
+ {{/* Categories */}}
+ {{ with (.GetTerms "categories") }} —
+ {{ range . }}
+ <a class="categories" href="{{ .RelPermalink }}" alt="{{ .LinkTitle }}">
+ {{ .LinkTitle }}
+ </a>
+ {{ end }}
+ {{ end }}
+ </div>
+ </header>
+
+ {{ partial "single/table-of-contents" . }}
+
+ <section>{{ .Content | emojify }}</section>
+
+ {{ partial "single/comments/index" . }}
+
+ <footer>
+ {{ with (.GetTerms "tags") }}
+ <div class="pb-14 taxonomy-list tags-list">
+ {{ range . }}
+ <a href="{{ .RelPermalink }}" alt="{{ .LinkTitle }}">
+ {{ .LinkTitle }}
+ </a>
+ {{ end }}
+ </div>
+ {{ end }}
+ </footer>
+</article>
+
+{{ end }}
diff --git a/layouts/index.html b/layouts/index.html
index 7f31f64..7cf7b9d 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,17 +1,9 @@
-{{ define "main" }}
-{{ if site.Params.isSinglePage }}
-{{ partial "single/homepage" . }}
-{{ else }}
-{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
-{{ $paginator := .Paginate $pages }}
-<div class="flex flex-col gap-1">
-<h3 class="text-2xl font-extrabold">Latest Posts</h3>
+{{ define "main" }}
+
+<div class="py-2 flex flex-col gap-1">
+ <h3 class="title-small">{{ .Title }}</h3>
</div>
-<section class="py-10 flex flex-col gap-10 ">
-{{ range $index, $pages := $paginator.Pages }}
- {{ partial "list/default" . }}
-{{ end }}
-</section>
-{{ partial "list/components/pagination" . }}
-{{ end }}
+
+ <section>{{ .Content }} </section>
+
{{ end }} \ No newline at end of file
diff --git a/layouts/partials/footer/copyright.html b/layouts/partials/footer/copyright.html
index b24cc2c..d2c9828 100644
--- a/layouts/partials/footer/copyright.html
+++ b/layouts/partials/footer/copyright.html
@@ -1,3 +1,12 @@
-<div class="text-xs font-semibold text-gray-500 order-2 sm:order-1 ">
- © {{ replace .Site.Copyright "{year}" now.Year }} — <a class="hover:text-gray-500" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a> <span class=" font-normal ">with</span> <a class="hover:text-gray-500" href="https://github.com/nixentric/Lowkey-Hugo-Theme" target="_blank" rel="noopener noreferrer">Lowkey</a>
-</div> \ No newline at end of file
+<div class="text-xs font-semibold text-gray-500 order-2 sm:order-1">
+ © {{ replace .Site.Copyright "{year}" now.Year }} —
+ <a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
+ <span class="font-normal">with</span>
+ <a
+ href="https://github.com/nixentric/Lowkey-Hugo-Theme"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ Lowkey
+ </a>
+</div>
diff --git a/layouts/partials/footer/index.html b/layouts/partials/footer/index.html
new file mode 100644
index 0000000..73f32ae
--- /dev/null
+++ b/layouts/partials/footer/index.html
@@ -0,0 +1,4 @@
+<footer class="pt-5 pb-10 grid gap-3 sm:grid-cols-2">
+ {{ partial "footer/copyright" . }}
+ {{ partial "footer/social" . }}
+</footer> \ No newline at end of file
diff --git a/layouts/partials/footer/social.html b/layouts/partials/footer/social.html
index 0b70dd6..ddf867c 100644
--- a/layouts/partials/footer/social.html
+++ b/layouts/partials/footer/social.html
@@ -1,5 +1,11 @@
-<div class="text-xs font-semibold text-gray-500 order-1 sm:order-2">
- <ul class="flex sm:justify-end gap-5">
- {{ with site.Menus.social }}{{ range . }}<li><a class="hover:text-gray-500" href="{{ .URL }}" target="_blank" rel="noopener noreferrer">{{ .Name }}</a></li>{{ end }}{{ end }}
- </ul>
-</div> \ No newline at end of file
+<div class="order-1 sm:order-2">
+ <ul class="flex sm:justify-end gap-5">
+ {{ with site.Menus.social }}
+ {{ range . }}
+ <li>
+ <a href="{{ .URL }}" target="_blank" rel="me noopener noreferrer">{{ .Name }}</a>
+ </li>
+ {{ end }}
+ {{ end }}
+ </ul>
+</div>
diff --git a/layouts/partials/head/index.html b/layouts/partials/head/index.html
new file mode 100644
index 0000000..eb096b8
--- /dev/null
+++ b/layouts/partials/head/index.html
@@ -0,0 +1,2 @@
+{{- partial "head/meta" . -}}
+{{- partial "head/styles" . -}}
diff --git a/layouts/partials/head/meta.html b/layouts/partials/head/meta.html
index 23a770a..329d9bf 100644
--- a/layouts/partials/head/meta.html
+++ b/layouts/partials/head/meta.html
@@ -1,12 +1,32 @@
-<meta charset="UTF-8">
-<meta http-equiv="X-UA-Compatible" content="IE=edge">
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
+{{ $favicon := resources.GetMatch .Site.Params.favicon }}
+
+<meta charset="UTF-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge" />
+<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }}{{ end }}</title>
-<meta name="description"
- content="{{ if .IsPage }}{{ or .Params.description .Summary }}{{ else if .IsHome }}{{ .Site.Params.description }}{{ else if .IsNode }}{{ or .Params.description .Summary }}{{ end }}">
-<link rel="canonical" href="{{ .Permalink }}">
-<link rel="robots" href="/robots.txt" />
-{{ with .OutputFormats.Get "rss" -}}
-{{ printf `
-<link rel=%q type=%q href=%q title=%q>` .Rel .MediaType.Type .Permalink site.Title | safeHTML }}
-{{ end }} \ No newline at end of file
+<meta
+ name="description"
+ content="{{ if .IsPage }}{{ or .Params.description .Summary }}{{ else if .IsHome }}{{ .Site.Params.description }}{{ else if .IsNode }}{{ or .Params.description .Summary }}{{ end }}"
+/>
+<link rel="canonical" href="{{ .Permalink }}" />
+<link rel="robots" href="/robot.txt" />
+
+<link rel="icon" type="image/x-icon" href="{{ $favicon.RelPermalink }}" />
+
+{{ if .Site.Config.Services.GoogleAnalytics.ID }}
+<!-- Google Analytics -->
+<script
+ defer
+ src="https://www.googletagmanager.com/gtag/js?id={{ .Site.Config.Services.GoogleAnalytics.ID }}"
+></script>
+<script>
+ window.dataLayer = window.dataLayer || [];
+ function gtag() {
+ dataLayer.push(arguments);
+ }
+ gtag('js', new Date());
+
+ gtag('config', '{{ .Site.Config.Services.GoogleAnalytics.ID }}');
+</script>
+<!-- End Google Analytics -->
+{{ end }}
diff --git a/layouts/partials/head/styles.html b/layouts/partials/head/styles.html
index 68577ce..cfab45a 100644
--- a/layouts/partials/head/styles.html
+++ b/layouts/partials/head/styles.html
@@ -1,13 +1,17 @@
-{{/* Resources */}}
-{{- $tailwind := resources.Get "css/tailwind.css" | postCSS (dict "config" "./config/postcss.config.js") -}}
+{{/* Resources */}}
+{{- $tailwind := resources.Get "css/tailwind.css" | postCSS (dict "config" "./config/postcss.config.js") -}}
-{{/* Processor */}}
-{{- $styles := slice $tailwind | resources.Concat "css/app.css" -}}
+{{/* MathJax */}}
+<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
+<script type="text/x-mathjax-config">MathJax.Hub.Config({ tex2jax: { inlineMath: [['$','$'], ['\\(','\\)']] } });</script>
-{{/* Output */}}
+{{/* Processor */}}
+{{- $styles := slice $tailwind | resources.Concat "css/app.css" -}}
+
+{{/* Output */}}
{{- if eq hugo.Environment "development" -}}
-<link rel="stylesheet" href="{{ $styles.Permalink | absURL }}">
-{{- else -}}
-{{- $styles := $styles | minify | fingerprint | resources.PostProcess -}}
-<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" >
+ <link rel="stylesheet" href="{{ $styles.Permalink | absURL }}" />
+{{- else -}}
+ {{- $styles := $styles | minify | fingerprint | resources.PostProcess -}}
+ <link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}" />
{{- end -}}
diff --git a/layouts/partials/header/avatar.html b/layouts/partials/header/avatar.html
index e3c1021..5c9447d 100644
--- a/layouts/partials/header/avatar.html
+++ b/layouts/partials/header/avatar.html
@@ -1,7 +1,14 @@
-{{ $avatar := resources.GetMatch .Site.Params.avatar }}
+{{ $avatar := resources.GetMatch .Site.Params.avatar }}
{{ $tiny := ($avatar.Fill "80x80 q90") }}
-<div class="flex-none w-20 h-20 rounded-full overflow-hidden" >
- <a href="{{ .Site.BaseURL }}">
- <img srcset="{{- with $tiny.RelPermalink -}}{{.}} 80w{{- end -}}" src="{{ $avatar.RelPermalink }}" width="{{ $avatar.Width }}" height="{{ $avatar.Height }}" alt="{{ .Site.Title }}">
- </a>
+
+<div class="flex-none w-20 h-20 rounded-full overflow-hidden">
+ <a href="{{ .Site.BaseURL }}">
+ <img
+ srcset="{{- with $tiny.RelPermalink -}}{{.}} 80w{{- end -}}"
+ src="{{ $avatar.RelPermalink }}"
+ width="{{ $avatar.Width }}"
+ height="{{ $avatar.Height }}"
+ alt="{{ .Site.Title }}"
+ />
+ </a>
</div>
diff --git a/layouts/partials/header/index.html b/layouts/partials/header/index.html
new file mode 100644
index 0000000..43debba
--- /dev/null
+++ b/layouts/partials/header/index.html
@@ -0,0 +1,8 @@
+<header class="flex flex-col sm:flex-row items-center gap-5 sm:gap-10 pt-16 py-12">
+ {{ partial "header/avatar" . }}
+
+ <div class="flex flex-col gap-5">
+ {{ partial "header/title" . }}
+ {{ partial "header/nav" . }}
+ </div>
+</header>
diff --git a/layouts/partials/header/nav.html b/layouts/partials/header/nav.html
index c0c20b3..94b073d 100644
--- a/layouts/partials/header/nav.html
+++ b/layouts/partials/header/nav.html
@@ -1,10 +1,14 @@
<nav>
- <ul class="flex flex-wrap justify-center uppercase text-xs font-semibold gap-7 text-gray-500 ">
- {{ $currentPage := . }}
- {{ range site.Menus.main }}
- {{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absLangURL }}
- {{- $page_url:= $currentPage.Permalink | absLangURL }}
- <li class="{{- if eq $menu_item_url $page_url }}text-gray-900{{else}}hover:text-gray-500{{ end -}}"><a href="{{ .URL }}">{{ .Name }}</a></li>
- {{ end }}
- </ul>
-</nav> \ No newline at end of file
+ <ul>
+ {{ $currentPage := . }}
+ {{ range site.Menus.main }}
+ {{- $menu_item_url := (cond (strings.HasSuffix .URL "/") .URL (printf "%s/" .URL) ) | absLangURL }}
+ {{- $page_url := $currentPage.Permalink | absLangURL }}
+ <li>
+ <a href="{{ .URL }}" class="{{ if eq $menu_item_url $page_url }} active {{ end }}">
+ {{ .Name }}
+ </a>
+ </li>
+ {{ end }}
+ </ul>
+</nav>
diff --git a/layouts/partials/header/theme-button.html b/layouts/partials/header/theme-button.html
new file mode 100644
index 0000000..0a8313b
--- /dev/null
+++ b/layouts/partials/header/theme-button.html
@@ -0,0 +1,47 @@
+<button class="toggle-theme" aria-label="Toggle Theme" title="Toggle Theme" onclick="toggleTheme()">
+ <span class="theme-icon light"> {{ partial "utils/icon" "sun" }} </span>
+ <span class="theme-icon dark"> {{ partial "utils/icon" "moon" }} </span>
+</button>
+
+<script>
+ document.addEventListener('DOMContentLoaded', function () {
+ const theme = localStorage.getItem('theme');
+
+ if (!theme || theme === 'light') {
+ setTheme('light');
+ } else {
+ setTheme(theme);
+ }
+ });
+
+ function setTheme(theme) {
+ const html = document.querySelector('html');
+ localStorage.setItem('theme', theme);
+
+ if (theme === 'light') {
+ if (html.classList.contains('dark')) {
+ document.querySelector('html').classList.remove('dark');
+ }
+
+ document.querySelector('.theme-icon.light').style.display = 'none';
+ document.querySelector('.theme-icon.dark').style.display = 'block';
+ } else {
+ if (!html.classList.contains('dark')) {
+ document.querySelector('html').classList.add('dark');
+ }
+
+ document.querySelector('.theme-icon.dark').style.display = 'none';
+ document.querySelector('.theme-icon.light').style.display = 'block';
+ }
+ }
+
+ function toggleTheme() {
+ const theme = localStorage.getItem('theme');
+
+ if (theme === 'light') {
+ setTheme('dark');
+ } else {
+ setTheme('light');
+ }
+ }
+</script> \ No newline at end of file
diff --git a/layouts/partials/header/title.html b/layouts/partials/header/title.html
index d6e6ba3..11bc434 100644
--- a/layouts/partials/header/title.html
+++ b/layouts/partials/header/title.html
@@ -1,7 +1,3 @@
<a href="{{ .Site.BaseURL }}">
- {{ if .IsHome }}
- <h1 class="text-center sm:text-left text-4xl font-extrabold text-gray-800 ">{{ .Site.Title }}</h1>
- {{ else }}
- <h3 class="text-center sm:text-left text-4xl font-extrabold text-gray-800 ">{{ .Site.Title }}</h3>
- {{ end }}
-</a> \ No newline at end of file
+ <h1 id="site-title">{{ .Site.Title }}</h1>
+</a>
diff --git a/layouts/partials/list/default.html b/layouts/partials/list/default.html
index a965ce5..f3fd20e 100644
--- a/layouts/partials/list/default.html
+++ b/layouts/partials/list/default.html
@@ -1,11 +1,28 @@
<article class="flex flex-col gap-1">
- <h1 class="text-xl font-bold hover:underline"> <a href=" {{ .Permalink }} ">{{ .Title }}</a></h1>
- <div class="text-gray-600">
+ <h1>
+ <a href="{{ .Permalink }}">{{ .Title }}</a>
+ </h1>
+
+ <span class="date">
+ <time datetime="{{ .PublishDate }}" title='{{ .PublishDate.Format "Mon, Jan 2, 2006, 3:04 PM MST" }}'>
+ {{ .PublishDate.Format "02/01/2006" }}
+ </time>
+ </span>
+
+ <div class="description">
{{ if .Params.description }}
- {{ .Params.description }}
- {{ else if .Summary }}
- {{ .Summary }}
+ {{ .Params.description }}
+ {{ else if .Summary }}
+ {{ .Summary }}
{{ end }}
- </div>
- <div class="mt-2"><a class="inline-flex gap-2 text-sm font-semibold items-center text-emerald-700 hover:text-emerald-600" href="{{ .Permalink }}">Read This Article <span class="w-4 h-4 stroke-2">{{ partial "handler/svg" "arrow-right" }}</span> </a> </div>
-</article> \ No newline at end of file
+ </div>
+
+ <div class="mt-2">
+ <a class="read-more" href="{{ .Permalink }}">
+ {{ i18n "readMore" }}
+ <span class="w-4 h-4 stroke-2">
+ {{ partial "utils/icon" "arrow-right" }}
+ </span>
+ </a>
+ </div>
+</article>
diff --git a/layouts/partials/list/pagination.html b/layouts/partials/list/pagination.html
new file mode 100644
index 0000000..2e9487c
--- /dev/null
+++ b/layouts/partials/list/pagination.html
@@ -0,0 +1,23 @@
+{{ $paginator := .Paginator }}
+
+<div class="pb-10 grid grid-cols-2 font-semibold">
+ <!-- Previous page. -->
+ <div>
+ {{ if $paginator.HasPrev }}
+ <a href="{{ $paginator.Prev.URL }}" class="pagination-button">
+ <span class="h-4 w-4 stroke-2"> {{ partial "utils/icon" "arrow-left" }} </span>
+ Newer Posts
+ </a>
+ {{ end }}
+ </div>
+
+ <!-- Next page. -->
+ <div class="flex justify-end">
+ {{ if $paginator.HasNext }}
+ <a href="{{ $paginator.Next.URL }}" class="pagination-button">
+ Older Posts
+ <span class="h-4 w-4 stroke-2"> {{ partial "utils/icon" "arrow-right" }} </span>
+ </a>
+ {{ end }}
+ </div>
+</div>
diff --git a/layouts/partials/single/comments/disqus.html b/layouts/partials/single/comments/disqus.html
new file mode 100644
index 0000000..b794098
--- /dev/null
+++ b/layouts/partials/single/comments/disqus.html
@@ -0,0 +1,4 @@
+<div class="disqus-comment">
+ {{/* https://gohugo.io/templates/internal/#disqus */}}
+ {{- template "_internal/disqus.html" . -}}
+</div> \ No newline at end of file
diff --git a/layouts/partials/single/comments/giscus.html b/layouts/partials/single/comments/giscus.html
new file mode 100644
index 0000000..00cfec1
--- /dev/null
+++ b/layouts/partials/single/comments/giscus.html
@@ -0,0 +1,22 @@
+<div class="giscus-comment">
+ <script
+ src="https://giscus.app/client.js"
+ data-repo="{{ .Site.Params.giscus.repo }}"
+ data-repo-id="{{ .Site.Params.giscus.repoId }}"
+ data-category="{{ .Site.Params.giscus.category }}"
+ data-category-id="{{ .Site.Params.giscus.categoryId }}"
+ data-mapping="{{ .Site.Params.giscus.mapping | default `pathname` }}"
+ data-strict="{{ (string .Site.Params.giscus.strict) | default 0 }}"
+ data-reactions-enabled="{{ (string .Site.Params.giscus.reactionsEnabled) | default 1 }}"
+ data-emit-metadata="{{ (string .Site.Params.giscus.emitMetadata) | default 0 }}"
+ data-input-position="{{ .Site.Params.giscus.inputPosition | default `top` }}"
+ data-theme="{{ .Site.Params.giscus.theme | default `light` }}"
+ data-lang="{{ .Site.Params.giscus.lang | default `en` }}"
+ {{ if .Site.Params.giscus.lazyLoading }}
+ data-loading="lazy"
+ {{ end }}
+ crossorigin="anonymous"
+ async
+ >
+ </script>
+</div> \ No newline at end of file
diff --git a/layouts/partials/single/comments/index.html b/layouts/partials/single/comments/index.html
new file mode 100644
index 0000000..5a4a1c3
--- /dev/null
+++ b/layouts/partials/single/comments/index.html
@@ -0,0 +1,11 @@
+{{ if .IsPage }}
+ <!-- giscus -->
+ {{ if .Site.Params.giscus.enable }}
+ {{ partial "single/comments/giscus" . }}
+ {{ end }}
+
+ <!-- disqus -->
+ {{ if .Site.Params.disqusShortname }}
+ {{ partial "single/comments/disqus" . }}
+ {{ end }}
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/single/table-of-contents.html b/layouts/partials/single/table-of-contents.html
new file mode 100644
index 0000000..b8489bc
--- /dev/null
+++ b/layouts/partials/single/table-of-contents.html
@@ -0,0 +1,6 @@
+{{ if and .TableOfContents .Params.tableOfContents }}
+ <aside class="table-of-contents">
+ <h2 class="title-small">{{ i18n "summary" }}</h2>
+ {{ .TableOfContents }}
+ </aside>
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/utils/icon.html b/layouts/partials/utils/icon.html
new file mode 100644
index 0000000..7f72418
--- /dev/null
+++ b/layouts/partials/utils/icon.html
@@ -0,0 +1,7 @@
+{{- $iconFile := resources.GetMatch (printf "icons/%s.svg" .) -}}
+
+{{- if $iconFile -}}
+ {{- $iconFile.Content | safeHTML -}}
+{{- else -}}
+ {{- errorf "Error: icon '%s.svg' is not found under 'assets/icons' folder" . -}}
+{{- end -}} \ No newline at end of file
diff --git a/layouts/shortcodes/alert.html b/layouts/shortcodes/alert.html
new file mode 100644
index 0000000..3a55964
--- /dev/null
+++ b/layouts/shortcodes/alert.html
@@ -0,0 +1,73 @@
+{{ $severity := .Get 0 }}
+{{ $title := .Get 1 }}
+
+<div class="alert-box {{ $severity }}">
+ {{ if $title }}
+ <h3 class="alert-title">{{ $title }}</h3>
+ {{ end }}
+ <p class="flex flex-row items-center gap-2">
+ {{ if eq $severity "info" }}
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="none"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ class="alert-icon"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"
+ />
+ </svg>
+ {{ else if eq $severity "warning" }}
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="none"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ class="alert-icon"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z"
+ />
+ </svg>
+ {{ else if eq $severity "error" }}
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="none"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ class="alert-icon"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ d="M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"
+ />
+ </svg>
+ {{ else if eq $severity "success" }}
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ fill="none"
+ viewBox="0 0 24 24"
+ stroke-width="1.5"
+ stroke="currentColor"
+ class="alert-icon"
+ >
+ <path
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ d="M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
+ />
+ </svg>
+
+ {{ end }}
+ {{.Inner}}
+ </p>
+</div>
diff --git a/layouts/shortcodes/details.html b/layouts/shortcodes/details.html
new file mode 100644
index 0000000..ca524f7
--- /dev/null
+++ b/layouts/shortcodes/details.html
@@ -0,0 +1,75 @@
+{{- /*
+Renders an HTML details element.
+
+@param {string} [class] The value of the element's class attribute.
+@param {string} [name] The value of the element's name attribute.
+@param {string} [summary] The content of the child summary element.
+@param {string} [title] The value of the element's title attribute.
+@param {bool} [open=false] Whether to initially display the content of the details element.
+
+@reference https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
+
+@examples
+
+ {{< details >}}
+ A basic collapsible section.
+ {{< /details >}}
+
+ {{< details summary="Custom Summary Text" >}}
+ Showing custom `summary` text.
+ {{< /details >}}
+
+ {{< details summary="Open Details" open=true >}}
+ Contents displayed initially by using `open`.
+ {{< /details >}}
+
+ {{< details summary="Styled Content" class="my-custom-class" >}}
+ Content can be styled with CSS by specifying a `class`.
+
+ Target details element:
+
+ ```css
+ details.my-custom-class { }
+ ```
+
+ Target summary element:
+
+ ```css
+ details.my-custom-class > summary > * { }
+ ```
+
+ Target inner content:
+
+ ```css
+ details.my-custom-class > :not(summary) { }
+ ```
+ {{< /details >}}
+
+ {{< details summary="Grouped Details" name="my-details" >}}
+ Specifying a `name` allows elements to be connected, with only one able to be open at a time.
+ {{< /details >}}
+
+*/}}
+
+{{- /* Get arguments. */}}
+{{- $class := or (.Get "class") "" }}
+{{- $name := or (.Get "name") "" }}
+{{- $summary := or (.Get "summary") "Details" }}
+{{- $title := or (.Get "title") "" }}
+{{- $open := false }}
+{{- if in (slice "false" false 0) (.Get "open") }}
+ {{- $open = false }}
+{{- else if in (slice "true" true 1) (.Get "open") }}
+ {{- $open = true }}
+{{- end }}
+
+{{- /* Render. */}}
+<details
+ {{- with $class }} class="{{ . }}" {{- end }}
+ {{- with $name }} name="{{ . }}" {{- end }}
+ {{- with $open }} open {{- end }}
+ {{- with $title }} title="{{ . }}" {{- end -}}
+>
+ <summary>{{ $summary | .Page.RenderString }}</summary>
+ {{ .Inner | .Page.RenderString (dict "display" "block") -}}
+</details> \ No newline at end of file
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html
index a0673a3..45ce3da 100644
--- a/layouts/shortcodes/img.html
+++ b/layouts/shortcodes/img.html
@@ -1,23 +1,16 @@
-{{/* Image Resources */}}
-{{ $img := .Page.Resources.GetMatch (printf "%s" (.Get "src" | safeURL ))}}
-{{ $alt := .Get "alt"}}
+{{ $img := .Page.Resources.GetMatch (printf "%s" (.Get "src" | safeURL )) }}
+{{ $alt := .Get "alt" }}
+{{ $caption := .Get "caption" }}
+{{ $captionPosition := .Get "caption-position" }}
-{{/* Image Processing */}}
-{{ $command := .Get "size-method" }}
-{{ $options := .Get "size-format" }}
-{{ if eq $command "Fit"}}
- {{ $img = $img.Fit $options }}
-{{ else if eq $command "Resize"}}
- {{ $img = $img.Resize $options }}
-{{ else if eq $command "Fill"}}
- {{ $img = $img.Fill $options }}
-{{ else if eq $command "Crop"}}
- {{ $img = $img.Crop $options }}
-{{ end }}
-
-{{/* Position */}}
-{{ $position := .Get "position" }}
-
-<figure class='mb-5{{ if eq $position "center" }} flex justify-center{{ end }}'>
- <img src="{{ $img.RelPermalink }}" {{ with $alt }}alt="{{ . }}"{{end}} width="{{ $img.Width }}" height="{{ $img.Height }}" >
+<figure class='mb-5'>
+ <img src="{{ $img.RelPermalink }}" {{ with $alt }} alt="{{ . }}" {{ end }} width="{{ $img.Width }}" height="{{ $img.Height }}" />
+
+ {{ with $caption }}
+ <figcaption
+ class='{{ if eq $captionPosition "center" }} flex justify-center {{ else if eq $captionPosition "end" }} flex justify-end {{ end }}'
+ >
+ {{ . }}
+ </figcaption>
+ {{ end }}
</figure> \ No newline at end of file
diff --git a/layouts/shortcodes/task-list.html b/layouts/shortcodes/task-list.html
new file mode 100644
index 0000000..fe4ffe7
--- /dev/null
+++ b/layouts/shortcodes/task-list.html
@@ -0,0 +1 @@
+<span class="task-list"></span>
diff --git a/layouts/taxonomies/home.html b/layouts/taxonomies/home.html
index 6a7dce5..0ee22c5 100644
--- a/layouts/taxonomies/home.html
+++ b/layouts/taxonomies/home.html
@@ -1,17 +1,29 @@
-{{ define "main" }}
-{{ $pages := .Pages }}
+{{ define "main" }}
+
<div class="flex flex-col gap-1">
-<h1 class="text-2xl font-extrabold">{{ if .Params.header }}{{ .Params.header }}{{ else }}{{ .Title }}{{ end }}</h1>
-{{ if .Content }}<p class="content text-lg text-gray-900">{{ .Content }}</p>{{ end }}
+ <h1 class="title-small">
+ {{ if .Params.header }}
+ {{ .Params.header }}
+ {{ else }}
+ {{ .Title }}
+ {{ end }}
+ </h1>
+
+ {{ with .Content }}
+ {{ . }}
+ {{ end }}
</div>
-<section class="py-10 flex flex-col gap-10 ">
-<ul class="taxonomy-list">
- {{ range $index, $pages}}
- {{ partial "list/categories" . }}
+<section class="py-10 flex flex-col gap-10">
+ <ul class="taxonomy-list">
+ {{ range $index, $pages := .Pages }}
+ <li>
+ <a href=" {{ .Permalink }} ">
+ {{ .Title }} ({{ len .Pages }})
+ </a>
+ </li>
{{ end }}
-</ul>
+ </ul>
</section>
-
{{ end }}