clean up and fix repo
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
class="bg-theme-light dark:bg-darkmode-theme-light rounded p-8 text-center">
|
||||
{{ $image:= .Params.image }}
|
||||
{{ if $image }}
|
||||
{{ partial "image" (dict "Src" $image "Alt" .Title "Class" "mx-auto mb-6 rounded" "size" "120x120") }}
|
||||
{{ partial "image" (dict "Src" $image "Context" .Page "Alt" .Title "Class" "mx-auto mb-6 rounded" "size" "120x120") }}
|
||||
{{ else if .Params.Email }}
|
||||
<img
|
||||
class="mx-auto mb-6 rounded"
|
||||
|
||||
@@ -1,35 +1,37 @@
|
||||
<div class="bg-body dark:bg-darkmode-body">
|
||||
{{ $image:= .Params.image }}
|
||||
{{ if $image }}
|
||||
{{ partial "image" (dict "Src" $image "Alt" .Title "Class" "mb-6 w-full rounded") }}
|
||||
{{ partial "image" (dict "Src" $image "Context" .Page "Alt" .Title "Class" "mb-6 w-full rounded") }}
|
||||
{{ end }}
|
||||
<h4 class="mb-3">
|
||||
<a href="{{ .RelPermalink }}">
|
||||
{{ .Title }}
|
||||
</a>
|
||||
</h4>
|
||||
<ul class="mb-4">
|
||||
<li class="mr-4 inline-block">
|
||||
<a href="{{ `authors/` | relLangURL }}{{ .Params.Author | urlize }}/">
|
||||
<i class="fa-regular fa-circle-user mr-2"></i>{{ .Params.author }}
|
||||
</a>
|
||||
</li>
|
||||
<li class="mr-4 inline-block">
|
||||
<i class="fa-regular fa-folder mr-2"></i>
|
||||
{{ $categories:= .Params.categories }}
|
||||
{{ range $i,$p:= $categories }}
|
||||
<a
|
||||
href="{{ `categories/` | relLangURL }}{{ . | urlize | lower }}/"
|
||||
class="ms-1"
|
||||
>{{ . | humanize }}{{ if ne $i (sub (len $categories) 1) }}
|
||||
{{ ", " }}
|
||||
{{ end }}
|
||||
{{ $categories:= .Params.categories }}
|
||||
{{ if $categories }}
|
||||
<ul class="mb-4">
|
||||
<li class="mr-4 inline-block">
|
||||
<a href="{{ `authors/` | relLangURL }}{{ .Params.Author | urlize }}/">
|
||||
<i class="fa-regular fa-circle-user mr-2"></i>{{ .Params.author }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="mr-4 inline-block">
|
||||
<i class="fa-regular fa-folder mr-1"></i>
|
||||
{{ range $i,$p:= $categories }}
|
||||
<a
|
||||
href="{{ `categories/` | relLangURL }}{{ . | urlize | lower }}/"
|
||||
class="ms-1"
|
||||
>{{ . | humanize }}{{ if ne $i (sub (len $categories) 1) }}
|
||||
{{ "," }}
|
||||
{{ end }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</li>
|
||||
</ul>
|
||||
{{ end }}
|
||||
<p class="mb-6">{{ .Summary }}</p>
|
||||
<a class="btn btn-outline-primary btn-sm" href="{{ .RelPermalink }}">
|
||||
{{ i18n "read_more" }}
|
||||
{{ T "read_more" }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<ul class="{{ $class }} inline-flex space-x-1 capitalize">
|
||||
<li>
|
||||
<a class="text-primary dark:text-darkmode-primary" href="{{ $base }}">
|
||||
{{ i18n "home" | default "Home" }}
|
||||
{{ T "home" | default "Home" }}
|
||||
</a>
|
||||
<span class="inlin-block mr-1">/</span>
|
||||
</li>
|
||||
@@ -16,7 +16,7 @@
|
||||
<a
|
||||
class="text-primary dark:text-darkmode-primary"
|
||||
href="{{ .RelPermalink }}">
|
||||
{{ .Title }}
|
||||
{{ T (printf "%s" (lower .Title)) | default .Title }}
|
||||
</a>
|
||||
<span class="inlin-block mr-1">/</span>
|
||||
</li>
|
||||
@@ -24,7 +24,7 @@
|
||||
{{ end }}
|
||||
<li>
|
||||
<span class="text-primary dark:text-darkmode-primary">
|
||||
{{ $context.Title }}
|
||||
{{ T (printf "%s" (lower $context.Title)) | default $context.Title }}
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<!-- theme switcher -->
|
||||
{{ $class := .Class }}
|
||||
{{ if site.Params.theme_switcher }}
|
||||
<div class="theme-switcher {{ $class }}">
|
||||
<div class="theme-switcher {{ $class }} hidden">
|
||||
<input id="theme-switcher" data-theme-switcher type="checkbox" />
|
||||
<label for="theme-switcher">
|
||||
<span class="sr-only">theme switcher</span>
|
||||
<span>
|
||||
<!-- sun -->
|
||||
<svg
|
||||
class="absolute left-[4px] top-[4px] z-10 opacity-100 dark:opacity-0"
|
||||
class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-10 opacity-100 dark:opacity-0"
|
||||
viewBox="0 0 56 56"
|
||||
fill="#fff"
|
||||
height="16"
|
||||
@@ -18,7 +18,7 @@
|
||||
</svg>
|
||||
<!-- moon -->
|
||||
<svg
|
||||
class="absolute left-[4px] top-[4px] z-10 opacity-0 dark:opacity-100"
|
||||
class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 z-10 opacity-0 dark:opacity-100"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
height="16"
|
||||
@@ -43,12 +43,17 @@
|
||||
|
||||
if (localStorage.getItem("theme") === "dark"){darkMode = true}
|
||||
else if (localStorage.getItem("theme") === "light"){darkMode = false}
|
||||
if (darkMode){document.documentElement.classList.toggle("dark")}
|
||||
var themeSwitch = document.querySelectorAll("[data-theme-switcher]");
|
||||
|
||||
if (darkMode){document.documentElement.classList.add("dark")}
|
||||
else {document.documentElement.classList.remove("dark")}
|
||||
|
||||
// Show theme switcher after applying theme
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
var themeSwitch = document.querySelectorAll("[data-theme-switcher]");
|
||||
var themeSwitcherContainer = document.querySelector('.theme-switcher');
|
||||
|
||||
[].forEach.call(themeSwitch, function (ts) {
|
||||
ts.checked = darkMode ? true : false;
|
||||
ts.checked = darkMode;
|
||||
ts.addEventListener("click", () => {
|
||||
document.documentElement.classList.toggle("dark");
|
||||
localStorage.setItem(
|
||||
@@ -57,6 +62,9 @@
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
// Now make the switcher visible
|
||||
themeSwitcherContainer.classList.remove('hidden');
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
@@ -56,3 +56,6 @@
|
||||
|
||||
<!-- Crisp Chat -->
|
||||
{{/* {{ partialCached "crisp-chat.html" . }} */}}
|
||||
|
||||
<!-- Mermaid -->
|
||||
{{ partial "mermaid/assets/js" . }}
|
||||
|
||||
@@ -111,7 +111,11 @@
|
||||
{{ if .enable }}
|
||||
<button
|
||||
aria-label="search"
|
||||
{{ if and (not site.Params.navigation_button.enable) (not site.Params.theme_switcher)}}
|
||||
class="border-border text-dark hover:text-primary dark:border-darkmode-border mr-5 inline-block border-r lg:border-r-0 pr-5 lg:pr-0 text-xl dark:text-white dark:hover:text-darkmode-primary"
|
||||
{{ else }}
|
||||
class="border-border text-dark hover:text-primary dark:border-darkmode-border mr-5 inline-block border-r pr-5 text-xl dark:text-white dark:hover:text-darkmode-primary"
|
||||
{{ end }}
|
||||
data-target="search-modal">
|
||||
<i class="fa-solid fa-search"></i>
|
||||
</button>
|
||||
|
||||
@@ -52,3 +52,7 @@
|
||||
|
||||
<!-- google adsense -->
|
||||
{{ partialCached "adsense-script.html" . }}
|
||||
|
||||
|
||||
<!-- cookie consent -->
|
||||
{{ partialCached "announcement-script.html" . }}
|
||||
|
||||
@@ -52,10 +52,10 @@
|
||||
{{/* main style */}}
|
||||
{{ $styles = $styles | append (resources.Get "scss/main.scss" | toCSS) }}
|
||||
{{ $styles = $styles | resources.Concat "css/style.css" }}
|
||||
{{ $styles = $styles | resources.PostCSS }}
|
||||
{{ $styles = $styles | css.PostCSS }}
|
||||
|
||||
{{ $stylesLazy = $stylesLazy | resources.Concat "css/style-lazy.css" }}
|
||||
{{ $stylesLazy = $stylesLazy | resources.PostCSS }}
|
||||
{{ $stylesLazy = $stylesLazy | css.PostCSS }}
|
||||
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $styles = $styles | resources.ExecuteAsTemplate "css/style.css" . | minify | fingerprint | resources.PostProcess }}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="container text-center">
|
||||
<div
|
||||
class="from-body to-theme-light dark:from-darkmode-body dark:to-darkmode-theme-light rounded-2xl bg-gradient-to-b px-8 py-14">
|
||||
<h1>{{ .Title | title }}</h1>
|
||||
<h1>{{ T (printf "%s" (lower .Title)) | default .Title | title }}</h1>
|
||||
{{ partial "components/breadcrumb" (dict "Context" . "Class" "mt-6") }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{{ if isset site.Taxonomies "categories" }}
|
||||
{{ if not (eq (len site.Taxonomies.categories) 0) }}
|
||||
<div class="mb-8">
|
||||
<h5 class="mb-6">{{ i18n "categories" }}</h5>
|
||||
<h5 class="mb-6">{{ T "categories" }}</h5>
|
||||
<div class="bg-theme-light dark:bg-darkmode-theme-light rounded p-8">
|
||||
<ul class="space-y-4">
|
||||
{{ range $name, $items := site.Taxonomies.categories }}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{{ if isset site.Taxonomies "tags" }}
|
||||
{{ if not (eq (len site.Taxonomies.tags) 0) }}
|
||||
<div class="mb-8">
|
||||
<h5 class="mb-6">Tags</h5>
|
||||
<h5 class="mb-6">{{ T "tags" }}</h5>
|
||||
<div class="bg-theme-light dark:bg-darkmode-theme-light rounded p-6">
|
||||
<ul>
|
||||
{{ range $name, $items := site.Taxonomies.tags }}
|
||||
|
||||
Reference in New Issue
Block a user