feat: migrate Hugo Bootstrap theme to latest Hugo with Tailwind CSS and refactor codebase
* replace Bootstrap-based styling with Tailwind CSS * update theme compatibility for latest Hugo version * refactor templates and partials * fix outdated code and broken components * improve project structure and maintainability * optimize styling and frontend build setup
This commit is contained in:
41
layouts/_partials/call-to-action.html
Normal file
41
layouts/_partials/call-to-action.html
Normal file
@@ -0,0 +1,41 @@
|
||||
{{ with site.GetPage "sections/call-to-action" }}
|
||||
{{ if .Params.enable }}
|
||||
{{ $ctaImage := resources.Get (strings.TrimPrefix "/" .Params.image) }}
|
||||
<section
|
||||
class="section bg-center bg-cover bg-no-repeat"
|
||||
{{ with $ctaImage }}
|
||||
style="background-image: url('{{ .RelPermalink }}');"
|
||||
{{ end }}>
|
||||
<div class="container text-center">
|
||||
<h2 class="h1 mb-2 xl:text-[70px]">
|
||||
{{ .Title | markdownify }}
|
||||
</h2>
|
||||
|
||||
<div class="mt-10 flex gap-6 justify-center flex-wrap">
|
||||
{{ with .Params.button_secondary }}
|
||||
{{ if .enable }}
|
||||
<a class="btn btn-secondary" href="{{ .link | absURL }}">
|
||||
<span class="btn-area">
|
||||
<span data-text="{{ .label }}">
|
||||
{{ .label }}
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with .Params.button_primary }}
|
||||
{{ if .enable }}
|
||||
<a class="btn btn-primary" href="{{ .link | absURL }}">
|
||||
<span class="btn-area">
|
||||
<span data-text="{{ .label }}">
|
||||
{{ .label }}
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
16
layouts/_partials/clients.html
Normal file
16
layouts/_partials/clients.html
Normal file
@@ -0,0 +1,16 @@
|
||||
{{ with site.GetPage "sections/clients" }}
|
||||
{{ if .Params.enable }}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h2 class="uppercase font-extralight tracking-widest mb-18">{{ .Params.title }}</h2>
|
||||
<ul class="grid grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-3 gap-y-14">
|
||||
{{ range .Params.client_logos }}
|
||||
<li>
|
||||
{{ partial "image" (dict "Src" . "Class" "object-contain mx-auto" "Alt" "client-logo") }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
29
layouts/_partials/components/blog-card.html
Normal file
29
layouts/_partials/components/blog-card.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<article class="relative group transition duration-300 hover:shadow-xl">
|
||||
<!-- Image -->
|
||||
{{ $image:= .Params.image }}
|
||||
{{ if $image }}
|
||||
{{ partial "image" (dict "Src" $image "Context" .Page "Alt" .Title "Class" "w-full") }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- Content -->
|
||||
<div
|
||||
class="absolute bottom-0 w-full bg-tertiary p-6 transition-all duration-300 group-hover:pb-20">
|
||||
<time class="text-primary/80" datetime= "{{ time.Format ":date_long" .PublishDate }}"> {{ time.Format ":date_long" .PublishDate }}</time>
|
||||
|
||||
<h4 class="font-semibold mt-1 mb-3">
|
||||
{{ .Title | markdownify }}
|
||||
</h4>
|
||||
|
||||
<p class="line-clamp-2">
|
||||
{{ .Description | markdownify}}
|
||||
</p>
|
||||
|
||||
<!-- Read More -->
|
||||
<a
|
||||
href="{{ .RelPermalink }}"
|
||||
class="absolute bottom-6 left-6 w-full opacity-0 translate-y-5 transition-all duration-300 group-hover:opacity-100 group-hover:translate-y-0 hover:text-primary hover:underline">
|
||||
{{ T "read_more" | default "Read More" }}
|
||||
</a>
|
||||
</div>
|
||||
</article>
|
||||
35
layouts/_partials/components/language-switcher.html
Normal file
35
layouts/_partials/components/language-switcher.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!-- Language List -->
|
||||
{{ if hugo.IsMultilingual }}
|
||||
{{ $class := .Class }}
|
||||
{{ $context := .Context }}
|
||||
{{ $pageLang := $context.Lang }}
|
||||
{{ $pageTranslations := newScratch }}
|
||||
{{/* First, fill all translations of the Home page (failsafe) */}}
|
||||
{{ range site.Home.AllTranslations }}
|
||||
{{ $pageTranslations.Set .Language.Lang .Permalink }}
|
||||
{{ end }}
|
||||
{{/* Second, if a translation exists for the current page for the target language, replace failsafe */}}
|
||||
{{ range $context.AllTranslations }}
|
||||
{{ $pageTranslations.Set .Language.Lang .Permalink }}
|
||||
{{ end }}
|
||||
|
||||
<select class="{{ $class }}" onchange="location = this.value">
|
||||
{{ range site.Languages }}
|
||||
{{/* Fill the dropdown with all known languages */}}
|
||||
{{ $link := $pageTranslations.Get .Lang }}
|
||||
{{ if $link }}
|
||||
<option
|
||||
id="{{ .Lang }}"
|
||||
value="{{ $link }}"
|
||||
{{ if eq .Lang $pageLang }}
|
||||
selected
|
||||
{{ end }}
|
||||
>
|
||||
{{ .LanguageName }}
|
||||
</option>
|
||||
{{ else }}
|
||||
{{/* if we can't safely redirect the user to the translated page or at least to translated home, discard the language from options */}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</select>
|
||||
{{ end }}
|
||||
138
layouts/_partials/components/pagination.html
Executable file
138
layouts/_partials/components/pagination.html
Executable 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="{{ T "pagination" | default "Pagination" }}">
|
||||
<!-- Previous page. -->
|
||||
{{ if $paginator.HasPrev }}
|
||||
<a
|
||||
class="text-text-dark hover:bg-light px-2 py-1.5"
|
||||
href="{{ $paginator.Prev.URL }}"
|
||||
aria-label="{{ T "pagination-arrow" | default "Pagination Arrow" }}">
|
||||
<span class="sr-only">{{ T "previous" | default "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-text-light px-2 py-1.5">
|
||||
<span class="sr-only">{{ T "previous" | default "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 px-4 py-2 text-white">
|
||||
{{ .PageNumber }}
|
||||
</span>
|
||||
{{ else }}
|
||||
<a
|
||||
href="{{ .URL }}"
|
||||
aria-current="page"
|
||||
class="text-text-dark hover:bg-light px-4 py-2">
|
||||
{{ .PageNumber }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- Next page. -->
|
||||
{{ if $paginator.HasNext }}
|
||||
<a
|
||||
class="text-text-dark hover:bg-light rounded px-2 py-1.5"
|
||||
href="{{ $paginator.Next.URL }}"
|
||||
aria-label="{{ T "pagination-arrow" | default "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-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 }}
|
||||
27
layouts/_partials/components/portfolio-card.html
Normal file
27
layouts/_partials/components/portfolio-card.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<article class="relative group transition duration-300 hover:shadow-xl">
|
||||
<!-- Image -->
|
||||
{{ $image:= .Params.image }}
|
||||
{{ if $image }}
|
||||
{{ partial "image" (dict "Src" $image "Context" .Page "Alt" .Title "Class" "w-full") }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- Content -->
|
||||
<div
|
||||
class="absolute bottom-0 w-full bg-tertiary p-6 transition-all duration-300 group-hover:pb-20">
|
||||
<ul class="block text-primary mb-2">
|
||||
<li>{{ delimit .Params.category ", " }}</li>
|
||||
</ul>
|
||||
|
||||
<h4 class="font-semibold">
|
||||
{{ .Title | markdownify }}
|
||||
</h4>
|
||||
|
||||
<!-- Read More -->
|
||||
<a
|
||||
href="{{ .Permalink }}"
|
||||
class="absolute bottom-6 left-6 w-full opacity-0 translate-y-5 transition-all duration-300 group-hover:opacity-100 group-hover:translate-y-0 hover:text-primary hover:underline">
|
||||
{{ .Params.button_label }}
|
||||
</a>
|
||||
</div>
|
||||
</article>
|
||||
9
layouts/_partials/components/tw-size-indicator.html
Normal file
9
layouts/_partials/components/tw-size-indicator.html
Normal file
@@ -0,0 +1,9 @@
|
||||
<div
|
||||
class="fixed left-0 top-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>
|
||||
152
layouts/_partials/essentials/footer.html
Executable file
152
layouts/_partials/essentials/footer.html
Executable file
@@ -0,0 +1,152 @@
|
||||
<footer class="section bg-secondary/70">
|
||||
<div class="container">
|
||||
{{ if site.Params.footer.footer_logo }}
|
||||
{{ partial "image" (dict
|
||||
"Src" site.Params.footer.footer_logo
|
||||
"Size" "120x50"
|
||||
"Alt" "footer logo"
|
||||
"DataAos" "fade-in-sm"
|
||||
"Class" "mb-4"
|
||||
)
|
||||
}}
|
||||
{{ else }}
|
||||
<a
|
||||
class="navbar-brand inline-block mb-4"
|
||||
href="{{ site.Home.RelPermalink }}">
|
||||
{{ partial "logo" }}
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
|
||||
<div class="mt-12 grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-y-14 gap-4 xl:gap-6">
|
||||
<!-- Contact Section -->
|
||||
<div>
|
||||
{{ $section_title := "" }}
|
||||
{{ range site.Menus.footer_01 }}
|
||||
{{ if .Title }}
|
||||
{{ $section_title = .Name }}
|
||||
{{ break }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<h6 class="mb-8 text-text-light">{{ $section_title }}</h6>
|
||||
<ul>
|
||||
{{ range site.Menus.footer_01 }}
|
||||
{{ if not .Title }}
|
||||
<li
|
||||
class="mb-3 last:mb-0 text-text-light text-wrap">
|
||||
<a class="hover:underline" href="{{ .URL | relLangURL }}" target="_blank">
|
||||
{{ .Name }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Services Section -->
|
||||
<div>
|
||||
{{ $section_title := "" }}
|
||||
{{ range site.Menus.footer_02 }}
|
||||
{{ if .Title }}
|
||||
{{ $section_title = .Name }}
|
||||
{{ break }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<h6 class="mb-8 text-text-light">{{ $section_title }}</h6>
|
||||
<ul>
|
||||
{{ range site.Menus.footer_02 }}
|
||||
{{ if not .Title }}
|
||||
<li
|
||||
class="mb-3 last:mb-0 text-text-light">
|
||||
<a hover:underline href="{{ .URL | relLangURL }}">
|
||||
{{ .Name }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- Social Section -->
|
||||
<div>
|
||||
<h6 class="mb-8 text-text-light">
|
||||
{{ with hugo.Data.social.title }}
|
||||
{{ . }}
|
||||
{{ else }}
|
||||
Social
|
||||
{{ end }}
|
||||
</h6>
|
||||
<ul>
|
||||
{{ range hugo.Data.social.main }}
|
||||
<li
|
||||
class="mb-3 last:mb-0 text-text-light">
|
||||
<a
|
||||
href="{{ .link | safeURL }}"
|
||||
class="capitalize hover:underline"
|
||||
target="_blank">
|
||||
{{ .name }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- About Section -->
|
||||
<div>
|
||||
<h6 class="mb-8 text-text-light">
|
||||
{{ site.Params.footer.footer_title }}
|
||||
</h6>
|
||||
<p
|
||||
class="mb-3 last:mb-0 text-text-light">
|
||||
{{ site.Params.footer.footer_description }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Back-To-Top Section -->
|
||||
<div>
|
||||
<a href="#" class="text-text-light js-back-to-top" aria-label="Back to top">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="26.071"
|
||||
height="32.634"
|
||||
viewBox="0 0 26.071 32.634">
|
||||
<g id="upload" transform="translate(-3.282)">
|
||||
<path
|
||||
id="Path_3"
|
||||
data-name="Path 3"
|
||||
d="M16.317,32.634a.5.5,0,0,1-.5-.5V.5a.5.5,0,0,1,1,0V32.134A.5.5,0,0,1,16.317,32.634Z"
|
||||
fill="currentColor" />
|
||||
<path
|
||||
id="Path_4"
|
||||
data-name="Path 4"
|
||||
d="M28.852,13.536a.5.5,0,0,1-.354-.146L16.319,1.207,4.135,13.39a.5.5,0,0,1-.707-.707L15.966.146A.5.5,0,0,1,16.319,0h0a.5.5,0,0,1,.354.146L29.206,12.682a.5.5,0,0,1-.354.854Z"
|
||||
fill="currentColor" />
|
||||
</g>
|
||||
</svg>
|
||||
|
||||
<p class="mt-4">
|
||||
{{ .Site.Params.footer.back_to_top | safeHTML }}
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{/* Smooth scroll script for back-to-top (prevents hash in URL) */}}
|
||||
<script>
|
||||
(function(){
|
||||
function onClick(e){
|
||||
e.preventDefault();
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' });
|
||||
}
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
var els = document.querySelectorAll('.js-back-to-top');
|
||||
for(var i=0;i<els.length;i++) els[i].addEventListener('click', onClick, {passive:false});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<p class="text-text-light text-center [&>a]:underline mt-14">
|
||||
{{ site.Params.copyright | markdownify }}
|
||||
</p>
|
||||
</div>
|
||||
</footer>
|
||||
65
layouts/_partials/essentials/head.html
Executable file
65
layouts/_partials/essentials/head.html
Executable file
@@ -0,0 +1,65 @@
|
||||
<meta charset="utf-8" />
|
||||
|
||||
<!-- responsive meta -->
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, maximum-scale=5" />
|
||||
|
||||
<!-- theme meta -->
|
||||
<meta name="theme-name" content="roxo-hugo" />
|
||||
|
||||
<!-- favicon -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/images */}}
|
||||
{{ partialCached "favicon" . }}
|
||||
|
||||
|
||||
<!-- manifest -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/pwa */}}
|
||||
{{ partialCached "manifest" . }}
|
||||
|
||||
|
||||
<!-- site verifications -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/seo-tools/site-verifications */}}
|
||||
{{ partialCached "site-verifications.html" . }}
|
||||
|
||||
|
||||
<!-- opengraph and twitter card -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/seo-tools/basic-seo */}}
|
||||
{{ partial "basic-seo.html" . }}
|
||||
|
||||
|
||||
<!-- custom script -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/components/custom-script */}}
|
||||
{{ partialCached "custom-script.html" . }}
|
||||
|
||||
|
||||
<!-- google analytics -->
|
||||
{{/* https://gohugo.io/templates/embedded/#configuration-google-analytics */}}
|
||||
{{ if and site.Config.Services.GoogleAnalytics.ID (ne site.Config.Services.GoogleAnalytics.ID "G-MEASUREMENT_ID") }}
|
||||
{{ partial "google_analytics.html" . }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- google tag manager -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/seo-tools/google-tag-manager */}}
|
||||
{{ partialCached "gtm.html" . }}
|
||||
|
||||
<!-- matomo analytics -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/seo-tools/matomo-analytics */}}
|
||||
{{/* {{ partialCached "matomo-analytics.html" . }} */}}
|
||||
|
||||
<!-- Baidu analytics -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/seo-tools/baidu-analytics */}}
|
||||
{{/* {{ partialCached "baidu-analytics.html" . }} */}}
|
||||
|
||||
<!-- Plausible Analytics -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/seo-tools/plausible-analytics */}}
|
||||
{{/* {{ partialCached "plausible-analytics.html" . }} */}}
|
||||
|
||||
<!-- Counter Analytics -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/seo-tools/counter-analytics */}}
|
||||
{{/* {{ partialCached "counter-analytics.html" . }} */}}
|
||||
|
||||
<!-- Crisp Chat -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/components/crisp-chat */}}
|
||||
{{/* {{ partialCached "crisp-chat.html" . }} */}}
|
||||
179
layouts/_partials/essentials/header.html
Executable file
179
layouts/_partials/essentials/header.html
Executable file
@@ -0,0 +1,179 @@
|
||||
<header
|
||||
id="site-header"
|
||||
data-navbar-fixed="{{ if site.Params.navbar_fixed }}
|
||||
true
|
||||
{{ else }}
|
||||
false
|
||||
{{ end }}"
|
||||
class="header {{ if site.Params.navbar_fixed }}
|
||||
fixed top-0
|
||||
{{ end }} inset-x-0 z-50 py-6 lg:py-6 transition-all duration-300 ease-in-out">
|
||||
<nav class="navbar container">
|
||||
<!-- logo -->
|
||||
<div class="order-0">
|
||||
<!-- navbar brand/logo -->
|
||||
<a class="navbar-brand block" href="{{ site.Home.RelPermalink }}">
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/images */}}
|
||||
{{ partial "logo" }}
|
||||
</a>
|
||||
</div>
|
||||
<!-- navbar toggler -->
|
||||
<input id="nav-toggle" type="checkbox" class="hidden" />
|
||||
<label
|
||||
for="nav-toggle"
|
||||
class="order-2 cursor-pointer flex items-center lg:hidden text-text-dark lg:order-1 ml-auto">
|
||||
<svg id="show-button" class="h-6 fill-current block" viewBox="0 0 20 20">
|
||||
<title>{{ T "menu-open" | default "Menu Open" }}</title>
|
||||
<path d="M0 3h20v2H0V3z m0 6h20v2H0V9z m0 6h20v2H0V0z"></path>
|
||||
</svg>
|
||||
<svg id="hide-button" class="h-6 fill-current hidden" viewBox="0 0 20 20">
|
||||
<title>{{ T "menu-close" | default "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 -->
|
||||
|
||||
<div class="order-3 flex flex-col lg:flex-row items-center lg:order-2 w-full lg:w-auto lg:justify-between">
|
||||
<!-- main navbar -->
|
||||
<ul
|
||||
id="nav-menu"
|
||||
class="navbar-nav hidden lg:flex w-full pb-6 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">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="submenu-{{ .Name | urlize }}"
|
||||
class="peer lg:hidden" />
|
||||
<label
|
||||
for="submenu-{{ .Name | urlize }}"
|
||||
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>
|
||||
</label>
|
||||
<ul
|
||||
class="nav-dropdown-list hidden peer-checked: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.Home.RelPermalink -}}
|
||||
{{- 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.Home.RelPermalink -}}
|
||||
{{- 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-primary"
|
||||
href="{{ site.Params.navigation_button.link | relLangURL }}"
|
||||
{{ if (hasPrefix site.Params.navigation_button.link `http`) }}
|
||||
target="_blank" rel="noopener"
|
||||
{{ end }}>
|
||||
{{ site.Params.navigation_button.label }}
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ partial "components/language-switcher" (dict "Context" . "Class" "mr-5 pl-2 py-1 rounded") }}
|
||||
|
||||
|
||||
<!-- navigation btn -->
|
||||
{{ if site.Params.navigation_button.enable }}
|
||||
<a
|
||||
href="{{ site.Params.navigation_button.link | relLangURL }}"
|
||||
class="btn btn-primary hidden lg:inline-block rounded-full"
|
||||
{{ if (hasPrefix site.Params.navigation_button.link `http`) }}
|
||||
target="_blank" rel="noopener"
|
||||
{{ end }}
|
||||
>
|
||||
<span class="btn-area">
|
||||
<span data-text="{{ site.Params.navigation_button.label }}">
|
||||
{{ site.Params.navigation_button.label }}
|
||||
</span>
|
||||
</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
{{/* Header shrink on scroll */}}
|
||||
<script>
|
||||
(function(){
|
||||
var header = document.getElementById('site-header');
|
||||
var lastScrollTop = 0;
|
||||
var shrunk = false;
|
||||
|
||||
if(!header) return;
|
||||
|
||||
function handleScroll(){
|
||||
var scrollTop = window.scrollY || document.documentElement.scrollTop;
|
||||
|
||||
if(scrollTop > 50){
|
||||
if(!shrunk){
|
||||
header.classList.remove('py-6', 'lg:py-6');
|
||||
header.classList.add('py-3', 'lg:py-3', 'shadow-md');
|
||||
shrunk = true;
|
||||
}
|
||||
} else {
|
||||
if(shrunk){
|
||||
header.classList.remove('py-3', 'lg:py-3', 'shadow-md');
|
||||
header.classList.add('py-6', 'lg:py-6');
|
||||
shrunk = false;
|
||||
}
|
||||
}
|
||||
lastScrollTop = scrollTop;
|
||||
}
|
||||
|
||||
window.addEventListener('scroll', handleScroll, {passive: true});
|
||||
})();
|
||||
</script>
|
||||
</header>
|
||||
57
layouts/_partials/essentials/script.html
Executable file
57
layouts/_partials/essentials/script.html
Executable file
@@ -0,0 +1,57 @@
|
||||
<!-- JS Plugins + Main script -->
|
||||
{{ $scripts := slice }}
|
||||
{{ $scriptsLazy := slice }}
|
||||
{{ range site.Params.plugins.js }}
|
||||
{{ if findRE "^http" .link }}
|
||||
<script
|
||||
src="{{ .link | relURL }}"
|
||||
type="application/javascript"
|
||||
{{ .attributes | safeHTMLAttr }}></script>
|
||||
{{ else }}
|
||||
{{ if not .lazy }}
|
||||
{{ $scripts = $scripts | append (resources.Get .link) }}
|
||||
{{ else }}
|
||||
{{ $scriptsLazy = $scriptsLazy | append (resources.Get .link) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- main script -->
|
||||
{{ $scripts = $scripts | append (resources.Get "js/main.js") }}
|
||||
{{ $scripts = $scripts | resources.Concat "js/script.js" }}
|
||||
|
||||
{{ $scriptsLazy = $scriptsLazy | resources.Concat "js/script-lazy.js" }}
|
||||
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $scripts = $scripts | minify | fingerprint }}
|
||||
{{ $scriptsLazy = $scriptsLazy | minify | fingerprint }}
|
||||
{{ end }}
|
||||
|
||||
{{/* scripts */}}
|
||||
<script
|
||||
crossorigin="anonymous"
|
||||
integrity="{{ $scripts.Data.Integrity }}"
|
||||
src="{{ $scripts.RelPermalink }}"></script>
|
||||
|
||||
{{/* scripts lazy */}}
|
||||
<script
|
||||
defer
|
||||
async
|
||||
crossorigin="anonymous"
|
||||
integrity="{{ $scriptsLazy.Data.Integrity }}"
|
||||
src="{{ $scriptsLazy.RelPermalink }}"></script>
|
||||
|
||||
<!-- progressive web app -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/pwa */}}
|
||||
{{ partialCached "pwa.html" . }}
|
||||
|
||||
|
||||
<!-- cookie consent -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/components/cookie-consent */}}
|
||||
{{ partialCached "cookie-consent.html" . }}
|
||||
|
||||
|
||||
<!-- google adsense -->
|
||||
{{/* https://github.com/gethugothemes/hugo-modules/tree/master/adsense */}}
|
||||
{{ partialCached "adsense-script.html" . }}
|
||||
80
layouts/_partials/essentials/style.html
Executable file
80
layouts/_partials/essentials/style.html
Executable file
@@ -0,0 +1,80 @@
|
||||
<!-- 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:= hugo.Data.theme.fonts.font_family.primary }}
|
||||
{{ $sf:= hugo.Data.theme.fonts.font_family.secondary }}
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||
<script>
|
||||
(function () {
|
||||
const googleFont = document.createElement("link");
|
||||
googleFont.href = "https://fonts.googleapis.com/css2?family={{$pf | safeURL}}{{with $sf}}&family={{. | safeURL}}{{end}}&display=swap";
|
||||
googleFont.type = "text/css";
|
||||
googleFont.rel = "stylesheet";
|
||||
document.head.appendChild(googleFont);
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- main styles -->
|
||||
{{ $styles := slice }}
|
||||
{{ $stylesLazy := slice }}
|
||||
|
||||
{{ range site.Params.plugins.css }}
|
||||
{{ if findRE "^http" .link }}
|
||||
<link
|
||||
crossorigin="anonymous"
|
||||
media="all"
|
||||
rel="stylesheet"
|
||||
href="{{ .link | relURL }}"
|
||||
{{ .attributes | safeHTMLAttr }} />
|
||||
{{ else }}
|
||||
{{ if not .lazy }}
|
||||
{{ $styles = $styles | append (resources.Get .link) }}
|
||||
{{ else }}
|
||||
{{ $stylesLazy = $stylesLazy | append (resources.Get .link) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $mainCSS := resources.Get "css/main.css" }}
|
||||
{{ $tailwindOpts := dict "inlineImports" true }}
|
||||
{{ $tailwindCSS := $mainCSS | css.TailwindCSS $tailwindOpts }}
|
||||
|
||||
{{ $styles = $styles | append $tailwindCSS }}
|
||||
{{ $styles = $styles | resources.Concat "css/style.css" }}
|
||||
|
||||
{{ $stylesLazy = $stylesLazy | resources.Concat "css/style-lazy.css" }}
|
||||
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $styles = $styles | fingerprint }}
|
||||
{{ $stylesLazy = $stylesLazy | minify | fingerprint }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- link main style -->
|
||||
<link
|
||||
href="{{ $styles.RelPermalink }}"
|
||||
integrity="{{ $styles.Data.Integrity }}"
|
||||
rel="stylesheet" />
|
||||
|
||||
<!-- link lazy style -->
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ $stylesLazy.RelPermalink }}"
|
||||
integrity="{{ $stylesLazy.Data.Integrity }}"
|
||||
media="print"
|
||||
onload="this.media='all'; this.onload=null;" />
|
||||
38
layouts/_partials/team.html
Normal file
38
layouts/_partials/team.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{{ with site.GetPage "sections/team" }}
|
||||
{{ if .Params.enable }}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h2 class="uppercase font-extralight tracking-widest mb-18">
|
||||
{{ .Params.title }}
|
||||
</h2>
|
||||
|
||||
<div class="grid gap-10 lg:gap-6 h-auto md:grid-cols-2 lg:grid-cols-3 auto-rows-fr items-stretch">
|
||||
{{ range .Params.members }}
|
||||
<div class="relative h-full flex flex-col pt-14">
|
||||
<figure class="absolute -top-4 lg:top-0 left-6 z-10">
|
||||
{{ partial "image" (dict "Src" .image "Class" "rounded-full" "Alt" .name) }}
|
||||
</figure>
|
||||
<div class="bg-tertiary p-6 pt-16 flex-1">
|
||||
<h3 class="h6 font-normal text-primary">{{ .name }}</h3>
|
||||
<p class="text-text-dark font-extralight mt-2 mb-4">{{ .designation }}</p>
|
||||
<ul class="social-icons">
|
||||
{{ range .social }}
|
||||
<li>
|
||||
<a
|
||||
href="{{ .link | safeURL }}"
|
||||
target="_blank"
|
||||
rel="noopener nofollow">
|
||||
<span class="sr-only">{{ .title }}</span>
|
||||
<i class="{{ .icon }}"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user