initialize hugoplate

This commit is contained in:
somrat sorkar
2023-05-25 16:41:54 +06:00
commit 06cb3ca494
106 changed files with 27286 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<div
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") }}
{{ else if .Params.Email }}
<img
class="mx-auto mb-6 rounded"
alt="{{ .Title }}"
height="120"
width="120"
src="https://www.gravatar.com/avatar/{{ md5 .Params.email }}?s=128&pg&d=identicon" />
{{ end }}
<h4 class="mb-3">
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h4>
<p class="mb-4">
{{ .Summary }}
</p>
<ul class="social-icons">
{{ if .Params.social.facebook }}
<li>
<a href="{{ . | safeURL }}" target="_blank" rel="noopener nofollow">
<i class="fa-brands fa-facebook-f"></i>
</a>
</li>
{{ end }}
{{ if .Params.social.twitter }}
<li>
<a href="{{ . | safeURL }}" target="_blank" rel="noopener nofollow">
<i class="fa-brands fa-twitter"></i>
</a>
</li>
{{ end }}
{{ if .Params.social.instagram }}
<li>
<a href="{{ . | safeURL }}" target="_blank" rel="noopener nofollow">
<i class="fa-brands fa-instagram"></i>
</a>
</li>
{{ end }}
</ul>
</div>

View File

@@ -0,0 +1,35 @@
<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") }}
{{ 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 }}
</a>
{{ end }}
</li>
</ul>
<p class="mb-6">{{ .Summary }}</p>
<a class="btn btn-outline-primary btn-sm" href="{{ .RelPermalink }}">
{{ i18n "read_more" }}
</a>
</div>

View File

@@ -0,0 +1,21 @@
<!-- Language List -->
{{ $class := .Class }}
{{ $context := .Context }}
{{ if $context.IsTranslated }}
<select class="{{ $class }}" onchange="location = this.value">
{{ $siteLanguages := site.Home.AllTranslations }}
{{ $pageLang := $context.Lang }}
{{ range $siteLanguages }}
{{ if eq (string $pageLang) (string .Language) }}
<option id="{{ .Language }}" value="{{ .RelPermalink }}" selected>
{{ .Language.LanguageName }}
</option>
{{ else }}
<option id="{{ .Language }}" value="{{ .RelPermalink }}">
{{ .Language.LanguageName }}
</option>
{{ end }}
{{ end }}
</select>
{{ end }}

View File

@@ -0,0 +1,138 @@
{{ $paginator := .Paginator }}
<!-- Number of links either side of the current page. -->
{{ $adjacent_links := 2 }}
<!-- $max_links = ($adjacent_links * 2) + 1 -->
{{ $max_links := (add (mul $adjacent_links 2) 1) }}
<!-- $lower_limit = $adjacent_links + 1 -->
{{ $lower_limit := (add $adjacent_links 1) }}
<!-- $upper_limit = $paginator.TotalPages - $adjacent_links -->
{{ $upper_limit := (sub $paginator.TotalPages $adjacent_links) }}
<!-- If there's more than one page. -->
{{ if gt $paginator.TotalPages 1 }}
<nav
class="flex items-center justify-center space-x-3"
aria-label="Pagination">
<!-- Previous page. -->
{{ if $paginator.HasPrev }}
<a
class="text-dark hover:bg-theme-light dark:text-darkmode-dark dark:hover:bg-darkmode-theme-light rounded px-2 py-1.5"
href="{{ $paginator.Prev.URL }}"
aria-label="Pagination Arrow">
<span class="sr-only">Previous</span>
<svg
viewBox="0 0 20 20"
fill="currentColor"
aria-hidden="true"
height="30"
width="30">
<path
fill-rule="evenodd"
d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
clip-rule="evenodd" />
</svg>
</a>
{{ else }}
<span class="text-light rounded px-2 py-1.5">
<span class="sr-only">Previous</span>
<svg
viewBox="0 0 20 20"
fill="currentColor"
aria-hidden="true"
height="30"
width="30">
<path
fill-rule="evenodd"
d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
clip-rule="evenodd" />
</svg>
</span>
{{ end }}
<!-- Page numbers -->
{{ range $paginator.Pagers }}
{{ $.Scratch.Set "page_number_flag" false }}
<!-- Advanced page numbers. -->
{{ if gt $paginator.TotalPages $max_links }}
<!-- Lower limit pages. -->
<!-- If the user is on a page which is in the lower limit. -->
{{ if le $paginator.PageNumber $lower_limit }}
<!-- If the current loop page is less than max_links. -->
{{ if le .PageNumber $max_links }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
<!-- Upper limit pages. -->
<!-- If the user is on a page which is in the upper limit. -->
{{ else if ge $paginator.PageNumber $upper_limit }}
<!-- If the current loop page is greater than total pages minus $max_links -->
{{ if gt .PageNumber (sub $paginator.TotalPages $max_links) }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
<!-- Middle pages. -->
{{ else }}
{{ if and ( ge .PageNumber (sub $paginator.PageNumber $adjacent_links) ) ( le .PageNumber (add $paginator.PageNumber $adjacent_links) ) }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
{{ end }}
<!-- Simple page numbers. -->
{{ else }}
{{ $.Scratch.Set "page_number_flag" true }}
{{ end }}
<!-- Output page numbers. -->
{{ if eq ($.Scratch.Get "page_number_flag") true }}
{{ if eq . $paginator }}
<span
aria-current="page"
class="bg-primary dark:bg-darkmode-primary dark:text-dark rounded px-4 py-2 text-white">
{{ .PageNumber }}
</span>
{{ else }}
<a
href="#"
aria-current="page"
class="text-dark hover:bg-theme-light dark:text-darkmode-dark dark:hover:bg-darkmode-theme-light rounded px-4 py-2">
{{ .PageNumber }}
</a>
{{ end }}
{{ end }}
{{ end }}
<!-- Next page. -->
{{ if $paginator.HasNext }}
<a
class="text-dark hover:bg-theme-light dark:text-darkmode-dark dark:hover:bg-darkmode-theme-light rounded px-2 py-1.5"
href="{{ $paginator.Next.URL }}"
aria-label="Pagination Arrow">
<span class="sr-only">Next</span>
<svg
viewBox="0 0 20 20"
fill="currentColor"
aria-hidden="true"
height="30"
width="30">
<path
fill-rule="evenodd"
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd" />
</svg>
</a>
{{ else }}
<span class="text-light rounded px-2 py-1.5">
<span class="sr-only">Next</span>
<svg
viewBox="0 0 20 20"
fill="currentColor"
aria-hidden="true"
height="30"
width="30">
<path
fill-rule="evenodd"
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd" />
</svg>
</span>
{{ end }}
</nav>
{{ end }}

View File

@@ -0,0 +1,65 @@
<!-- theme switcher -->
{{ $class := .Class }}
{{ if site.Params.theme_switcher }}
<div class="theme-switcher {{ $class }}">
<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"
viewBox="0 0 56 56"
fill="#fff"
height="16"
width="16">
<path
d="M30 4.6c0-1-.9-2-2-2a2 2 0 0 0-2 2v5c0 1 .9 2 2 2s2-1 2-2Zm9.6 9a2 2 0 0 0 0 2.8c.8.8 2 .8 2.9 0L46 13a2 2 0 0 0 0-2.9 2 2 0 0 0-3 0Zm-26 2.8c.7.8 2 .8 2.8 0 .8-.7.8-2 0-2.9L13 10c-.7-.7-2-.8-2.9 0-.7.8-.7 2.1 0 3ZM28 16a12 12 0 0 0-12 12 12 12 0 0 0 12 12 12 12 0 0 0 12-12 12 12 0 0 0-12-12Zm23.3 14c1.1 0 2-.9 2-2s-.9-2-2-2h-4.9a2 2 0 0 0-2 2c0 1.1 1 2 2 2ZM4.7 26a2 2 0 0 0-2 2c0 1.1.9 2 2 2h4.9c1 0 2-.9 2-2s-1-2-2-2Zm37.8 13.6a2 2 0 0 0-3 0 2 2 0 0 0 0 2.9l3.6 3.5a2 2 0 0 0 2.9 0c.8-.8.8-2.1 0-3ZM10 43.1a2 2 0 0 0 0 2.9c.8.7 2.1.8 3 0l3.4-3.5c.8-.8.8-2.1 0-2.9-.8-.8-2-.8-2.9 0Zm20 3.4c0-1.1-.9-2-2-2a2 2 0 0 0-2 2v4.9c0 1 .9 2 2 2s2-1 2-2Z" />
</svg>
<!-- moon -->
<svg
class="absolute left-[4px] top-[4px] z-10 opacity-0 dark:opacity-100"
viewBox="0 0 24 24"
fill="none"
height="16"
width="16">
<path
fill="#000"
fill-rule="evenodd"
clip-rule="evenodd"
d="M8.2 2.2c1-.4 2 .6 1.6 1.5-1 3-.4 6.4 1.8 8.7a8.4 8.4 0 0 0 8.7 1.8c1-.3 2 .5 1.5 1.5v.1a10.3 10.3 0 0 1-9.4 6.2A10.3 10.3 0 0 1 3.2 6.7c1-2 2.9-3.5 4.9-4.4Z" />
</svg>
</span>
</label>
</div>
<!-- theme switcher -->
{{ if site.Params.theme_switcher }}
<script>
var darkMode = {{if eq site.Params.theme_default "dark"}}true{{else}}false{{end}};
{{ if eq site.Params.theme_default "system" }}
if (window.matchMedia("(prefers-color-scheme: dark)").matches){darkMode = true}
{{ end }}
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]");
document.addEventListener("DOMContentLoaded", () => {
[].forEach.call(themeSwitch, function (ts) {
ts.checked = darkMode ? true : false;
ts.addEventListener("click", () => {
document.documentElement.classList.toggle("dark");
localStorage.setItem(
"theme",
document.documentElement.classList.contains("dark") ? "dark" : "light"
);
});
});
});
</script>
{{ end }}
{{ end }}

View File

@@ -0,0 +1,9 @@
<div
class="fixed top-0 left-0 z-50 flex w-[30px] items-center justify-center bg-gray-200 py-[2.5px] text-[12px] uppercase text-black sm:bg-red-200 md:bg-yellow-200 lg:bg-green-200 xl:bg-blue-200 2xl:bg-pink-200">
<span class="block sm:hidden">all</span>
<span class="hidden sm:block md:hidden">sm</span>
<span class="hidden md:block lg:hidden">md</span>
<span class="hidden lg:block xl:hidden">lg</span>
<span class="hidden xl:block 2xl:hidden">xl</span>
<span class="hidden 2xl:block">2xl</span>
</div>