initialize hugoplate
This commit is contained in:
57
layouts/partials/essentials/footer.html
Executable file
57
layouts/partials/essentials/footer.html
Executable file
@@ -0,0 +1,57 @@
|
||||
<footer class="bg-theme-light dark:bg-darkmode-theme-light">
|
||||
<div class="container">
|
||||
<div class="row items-center py-10">
|
||||
<div class="lg:col-3 mb-8 text-center lg:mb-0 lg:text-left">
|
||||
<!-- navbar brand/logo -->
|
||||
<a
|
||||
class="navbar-brand inline-block"
|
||||
href="{{ site.BaseURL | relLangURL }}">
|
||||
{{ partial "logo" }}
|
||||
</a>
|
||||
</div>
|
||||
<div class="lg:col-6 mb-8 text-center lg:mb-0">
|
||||
<ul>
|
||||
{{ range site.Menus.footer }}
|
||||
<li class="m-3 inline-block">
|
||||
<a
|
||||
{{ if findRE `^http` .URL }}
|
||||
target="_blank" rel="noopener"
|
||||
{{ end }}
|
||||
href="{{ if findRE `^#` .URL }}
|
||||
{{ if not $.IsHome }}
|
||||
{{ site.BaseURL | relLangURL }}
|
||||
{{ end }}{{ .URL }}
|
||||
{{ else }}
|
||||
{{ .URL | relLangURL }}
|
||||
{{ end }}"
|
||||
>{{ .Name }}</a
|
||||
>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="lg:col-3 mb-8 text-center lg:mb-0 lg:mt-0 lg:text-right">
|
||||
<ul class="social-icons">
|
||||
{{ range site.Params.social }}
|
||||
<li>
|
||||
<a
|
||||
target="_blank"
|
||||
aria-label="{{ .name }}"
|
||||
rel="nofollow noopener"
|
||||
href="{{ .link | safeURL }}">
|
||||
<i class="{{ .icon }}"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-border dark:border-darkmode-border border-t py-7">
|
||||
<div class="text-light dark:text-darkmode-light container text-center">
|
||||
<p>
|
||||
{{ site.Params.copyright | markdownify }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
56
layouts/partials/essentials/head.html
Executable file
56
layouts/partials/essentials/head.html
Executable file
@@ -0,0 +1,56 @@
|
||||
<meta charset="utf-8" />
|
||||
<title>{{ .Title | default site.Title }}</title>
|
||||
|
||||
<!-- responsive meta -->
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, maximum-scale=5" />
|
||||
|
||||
<!-- theme meta -->
|
||||
<meta name="theme-name" content="hugoplate" />
|
||||
|
||||
<!-- favicon -->
|
||||
{{ partialCached "favicon" . }}
|
||||
|
||||
|
||||
<!-- manifest -->
|
||||
{{ partialCached "manifest" . }}
|
||||
|
||||
|
||||
<!-- site verifications -->
|
||||
{{ partialCached "site-verifications.html" . }}
|
||||
|
||||
|
||||
<!-- opengraph and twitter card -->
|
||||
{{ partial "basic-seo.html" . }}
|
||||
|
||||
|
||||
<!-- custom script -->
|
||||
{{ partialCached "custom-script.html" . }}
|
||||
|
||||
|
||||
<!-- google analytics -->
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
|
||||
|
||||
<!-- google tag manager -->
|
||||
{{ partialCached "gtm.html" . }}
|
||||
|
||||
|
||||
<!-- matomo analytics -->
|
||||
{{/* {{ partialCached "matomo-analytics.html" . }} */}}
|
||||
|
||||
<!-- Baidu analytics -->
|
||||
{{/* {{ partialCached "baidu-analytics.html" . }} */}}
|
||||
|
||||
<!-- Plausible Analytics -->
|
||||
{{/* {{ partialCached "plausible-analytics.html" . }} */}}
|
||||
|
||||
<!-- Counter Analytics -->
|
||||
{{/* {{ partialCached "counter-analytics.html" . }} */}}
|
||||
|
||||
<!-- Crisp Chat -->
|
||||
{{/* {{ partialCached "crisp-chat.html" . }} */}}
|
||||
|
||||
<!-- search index -->
|
||||
{{ partial "search-index.html" . }}
|
140
layouts/partials/essentials/header.html
Executable file
140
layouts/partials/essentials/header.html
Executable file
@@ -0,0 +1,140 @@
|
||||
<header
|
||||
class="header {{ if site.Params.navbar_fixed }}sticky top-0{{ end }} z-30">
|
||||
<nav class="navbar container">
|
||||
<!-- logo -->
|
||||
<div class="order-0">
|
||||
<!-- navbar brand/logo -->
|
||||
<a class="navbar-brand block" href="{{ site.BaseURL | relLangURL }}">
|
||||
{{ partial "logo" }}
|
||||
</a>
|
||||
</div>
|
||||
<!-- navbar toggler -->
|
||||
<input id="nav-toggle" type="checkbox" class="hidden" />
|
||||
<label
|
||||
id="show-button"
|
||||
for="nav-toggle"
|
||||
class="order-2 flex cursor-pointer items-center md:order-1 md:hidden">
|
||||
<svg class="h-6 fill-current" viewBox="0 0 20 20">
|
||||
<title>Menu Open</title>
|
||||
<path d="M0 3h20v2H0V3z m0 6h20v2H0V9z m0 6h20v2H0V0z"></path>
|
||||
</svg>
|
||||
</label>
|
||||
<label
|
||||
id="hide-button"
|
||||
for="nav-toggle"
|
||||
class="order-2 hidden cursor-pointer items-center md:order-1">
|
||||
<svg class="h-6 fill-current" viewBox="0 0 20 20">
|
||||
<title>Menu Close</title>
|
||||
<polygon
|
||||
points="11 9 22 9 22 11 11 11 11 22 9 22 9 11 -2 11 -2 9 9 9 9 -2 11 -2"
|
||||
transform="rotate(45 10 10)"></polygon>
|
||||
</svg>
|
||||
</label>
|
||||
<!-- /navbar toggler -->
|
||||
|
||||
<!-- main navbar -->
|
||||
<ul
|
||||
id="nav-menu"
|
||||
class="navbar-nav order-3 hidden w-full pb-6 lg:order-1 lg:flex lg:w-auto lg:space-x-2 lg:pb-0 xl:space-x-8">
|
||||
{{ $currentPage := . }}
|
||||
{{ range site.Menus.main }}
|
||||
{{ $menuURL := .URL | absLangURL }}
|
||||
{{ $pageURL:= $currentPage.Permalink | absLangURL }}
|
||||
{{ $active := eq $menuURL $pageURL }}
|
||||
{{ if .HasChildren }}
|
||||
<li class="nav-item nav-dropdown group relative">
|
||||
<span
|
||||
class="nav-link {{ range .Children }}
|
||||
{{ $childURL := .URL | absLangURL }}
|
||||
{{ $active := eq $childURL $pageURL }}
|
||||
{{ if $active }}active{{ end }}
|
||||
{{ end }} inline-flex items-center">
|
||||
{{ .Name }}
|
||||
<svg class="h-4 w-4 fill-current" viewBox="0 0 20 20">
|
||||
<path
|
||||
d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z" />
|
||||
</svg>
|
||||
</span>
|
||||
<ul
|
||||
class="nav-dropdown-list hidden group-hover:block lg:invisible lg:absolute lg:block lg:opacity-0 lg:group-hover:visible lg:group-hover:opacity-100">
|
||||
{{ range .Children }}
|
||||
{{ $childURL := .URL | absLangURL }}
|
||||
{{ $active := eq $childURL $pageURL }}
|
||||
<li class="nav-dropdown-item">
|
||||
<a
|
||||
class="nav-dropdown-link {{ if $active }}
|
||||
active
|
||||
{{ end }}"
|
||||
{{ if findRE `^http` .URL }}
|
||||
target="_blank" rel="noopener"
|
||||
{{ end }}
|
||||
href="{{ if findRE `^#` .URL }}
|
||||
{{ if not $.IsHome }}
|
||||
{{ site.BaseURL | relLangURL }}
|
||||
{{ end }}{{ .URL }}
|
||||
{{ else }}
|
||||
{{ .URL | relLangURL }}
|
||||
{{ end }}">
|
||||
{{ .Name }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li class="nav-item">
|
||||
<a
|
||||
class="nav-link {{ if $active }}active{{ end }}"
|
||||
{{ if findRE `^http` .URL }}
|
||||
target="_blank" rel="noopener"
|
||||
{{ end }}
|
||||
href="{{ if findRE `^#` .URL }}
|
||||
{{ if not $.IsHome }}
|
||||
{{ site.BaseURL | relLangURL }}
|
||||
{{ end }}{{ .URL }}
|
||||
{{ else }}
|
||||
{{ .URL | relLangURL }}
|
||||
{{ end }}"
|
||||
>{{ .Name }}</a
|
||||
>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ if site.Params.navigation_button.enable }}
|
||||
<li class="mt-4 inline-block lg:hidden">
|
||||
<a
|
||||
class="btn btn-outline-primary btn-sm"
|
||||
href="{{ site.Params.navigation_button.link | relLangURL }}">
|
||||
{{ site.Params.navigation_button.label }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
|
||||
<div class="order-1 ml-auto flex items-center md:order-2 lg:ml-0">
|
||||
{{ with site.Params.search }}
|
||||
{{ if .enable }}
|
||||
<button
|
||||
aria-label="search"
|
||||
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"
|
||||
data-target="search-modal">
|
||||
<i class="fa-solid fa-search"></i>
|
||||
</button>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ partial "components/language-switcher" (dict "Context" . "Class" "mr-5 pl-2 py-1 dark:bg-darkmode-theme-light rounded") }}
|
||||
{{ partial "components/theme-switcher" (dict "Class" "mr-5") }}
|
||||
|
||||
|
||||
<!-- navigation btn -->
|
||||
{{ if site.Params.navigation_button.enable }}
|
||||
<a
|
||||
href="{{ site.Params.navigation_button.link | relLangURL }}"
|
||||
class="btn btn-outline-primary btn-sm hidden lg:inline-block">
|
||||
{{ site.Params.navigation_button.label }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
37
layouts/partials/essentials/script.html
Executable file
37
layouts/partials/essentials/script.html
Executable file
@@ -0,0 +1,37 @@
|
||||
<!-- JS Plugins + Main script -->
|
||||
{{ $scripts := slice }}
|
||||
{{ range site.Params.plugins.js }}
|
||||
{{ if findRE "^http" .link }}
|
||||
<script
|
||||
src="{{ .link | relURL }}"
|
||||
type="application/javascript"
|
||||
{{ .attributes | safeHTMLAttr }}></script>
|
||||
{{ else }}
|
||||
{{ $scripts = $scripts | append (resources.Get .link) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- main script -->
|
||||
{{ $scripts = $scripts | append (resources.Get "js/main.js") }}
|
||||
{{ $scripts = $scripts | resources.Concat "js/script.js" }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $scripts = $scripts | minify | fingerprint }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<script
|
||||
crossorigin="anonymous"
|
||||
integrity="{{ $scripts.Data.Integrity }}"
|
||||
src="{{ $scripts.RelPermalink }}"></script>
|
||||
|
||||
<!-- progressive web app -->
|
||||
{{ partialCached "pwa.html" . }}
|
||||
|
||||
|
||||
<!-- cookie consent -->
|
||||
{{ partialCached "cookie-consent.html" . }}
|
||||
|
||||
|
||||
<!-- google adsense -->
|
||||
{{ partialCached "adsense-script.html" . }}
|
55
layouts/partials/essentials/style.html
Executable file
55
layouts/partials/essentials/style.html
Executable file
@@ -0,0 +1,55 @@
|
||||
<!-- DNS preconnect -->
|
||||
<meta http-equiv="x-dns-prefetch-control" content="on" />
|
||||
<link rel="preconnect" href="https://use.fontawesome.com" crossorigin />
|
||||
<link rel="preconnect" href="//cdnjs.cloudflare.com" />
|
||||
<link rel="preconnect" href="//www.googletagmanager.com" />
|
||||
<link rel="preconnect" href="//www.google-analytics.com" />
|
||||
<link rel="dns-prefetch" href="https://use.fontawesome.com" />
|
||||
<link rel="dns-prefetch" href="//ajax.googleapis.com" />
|
||||
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com" />
|
||||
<link rel="dns-prefetch" href="//www.googletagmanager.com" />
|
||||
<link rel="dns-prefetch" href="//www.google-analytics.com" />
|
||||
<link rel="dns-prefetch" href="//fonts.googleapis.com" />
|
||||
<link rel="dns-prefetch" href="//connect.facebook.net" />
|
||||
<link rel="dns-prefetch" href="//platform.linkedin.com" />
|
||||
<link rel="dns-prefetch" href="//platform.twitter.com" />
|
||||
|
||||
<!-- google fonts -->
|
||||
{{ $pf:= site.Params.fonts.font_family.primary }}
|
||||
{{ $sf:= site.Params.fonts.font_family.secondary }}
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<link
|
||||
href="https://fonts.googleapis.com/css2?family={{- $pf | safeURL -}}{{- with $sf -}}
|
||||
&family={{- . | safeURL -}}
|
||||
{{- end -}}&display=swap"
|
||||
rel="stylesheet" />
|
||||
|
||||
<!-- plugins + stylesheet -->
|
||||
{{ $styles := slice }}
|
||||
{{ range site.Params.plugins.css }}
|
||||
{{ if findRE "^http" .link }}
|
||||
<link
|
||||
crossorigin="anonymous"
|
||||
media="all"
|
||||
rel="stylesheet"
|
||||
href="{{ .link | relURL }}"
|
||||
{{ .attributes | safeHTMLAttr }} />
|
||||
{{ else }}
|
||||
{{ $styles = $styles | append (resources.Get .link) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $styles := $styles | append (resources.Get "scss/main.scss" | toCSS) }}
|
||||
{{ $styles := $styles | resources.Concat "css/style.css" }}
|
||||
{{ $styles = $styles | resources.PostCSS }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $styles = $styles | resources.ExecuteAsTemplate "css/style.css" . | minify | fingerprint | resources.PostProcess }}
|
||||
{{ else }}
|
||||
{{ $styles = $styles | resources.ExecuteAsTemplate "css/style.css" . }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<link
|
||||
href="{{ $styles.RelPermalink }}"
|
||||
integrity="{{ $styles.Data.Integrity }}"
|
||||
rel="stylesheet" />
|
Reference in New Issue
Block a user