Initial commit for Hugo site.
This commit is contained in:
@@ -0,0 +1,234 @@
|
||||
<header class="py-6 font-semibold text-neutral-900 print:hidden sm:py-10 dark:text-neutral">
|
||||
<nav class="flex items-start justify-between sm:items-center">
|
||||
{{/* Site logo/title */}}
|
||||
<div class="z-40 flex flex-row items-center">
|
||||
{{ partial "logo.html" . }}
|
||||
</div>
|
||||
{{ if or .Site.Menus.main (.Site.Params.enableSearch | default false) }}
|
||||
{{/* Hamburger menu */}}
|
||||
<label id="menu-button" for="menu-controller" class="block sm:hidden">
|
||||
<input type="checkbox" id="menu-controller" class="hidden" />
|
||||
<div class="cursor-pointer hover:text-primary-600 dark:hover:text-primary-400">
|
||||
{{ partial "icon.html" "bars" }}
|
||||
</div>
|
||||
<div
|
||||
id="menu-wrapper"
|
||||
class="invisible fixed inset-0 z-30 m-auto h-full w-full cursor-default overflow-auto bg-neutral-100/50 opacity-0 backdrop-blur-sm transition-opacity dark:bg-neutral-900/50"
|
||||
>
|
||||
<ul
|
||||
class="mx-auto flex w-full max-w-7xl list-none flex-col overflow-visible px-6 py-6 text-end sm:px-14 sm:py-10 sm:pt-10 md:px-24 lg:px-32"
|
||||
>
|
||||
<li class="mb-1">
|
||||
<span class="cursor-pointer hover:text-primary-600 dark:hover:text-primary-400"
|
||||
>{{ partial "icon.html" "xmark" }}</span
|
||||
>
|
||||
</li>
|
||||
{{ if .Site.Menus.main }}
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ if and (eq .Params.action "locale") (or (not page.IsTranslated) (not site.IsMultiLingual)) }}
|
||||
{{ continue }}
|
||||
{{ end }}
|
||||
<li class="group mb-1">
|
||||
{{ if eq .Params.action "search" }}
|
||||
{{ $.Scratch.Add "searchCount" 1 }}
|
||||
{{ if $.Site.Params.enableSearch | default false }}
|
||||
<button
|
||||
id="search-button-{{ $.Scratch.Get "searchCount" }}"
|
||||
title="{{ .Title | default (i18n "search.open_button_title") }}"
|
||||
>
|
||||
{{ with .Params.icon | default "search" }}
|
||||
<span
|
||||
class="group-dark:hover:text-primary-400 transition-colors group-hover:text-primary-600"
|
||||
>
|
||||
{{- partial "icon.html" . -}}
|
||||
</span>
|
||||
{{- end -}}{{- if .Params.showName | default true -}}
|
||||
<span
|
||||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2"
|
||||
>{{ .Name | markdownify | emojify }}</span
|
||||
>
|
||||
{{ end }}
|
||||
</button>
|
||||
{{ end }}
|
||||
{{ else if eq .Params.action "appearance" }}
|
||||
{{ $.Scratch.Add "switchCount" 1 }}
|
||||
<button
|
||||
id="appearance-switcher-{{ $.Scratch.Get "switchCount" }}"
|
||||
type="button"
|
||||
aria-label="appearance switcher"
|
||||
>
|
||||
<span
|
||||
class="group-dark:hover:text-primary-400 inline transition-colors group-hover:text-primary-600 dark:hidden"
|
||||
title="{{ i18n "footer.dark_appearance" }}"
|
||||
>
|
||||
{{ with .Params.icon | default "moon" }}
|
||||
{{- partial "icon.html" . -}}
|
||||
{{- end -}}
|
||||
{{- if .Params.showName | default true -}}
|
||||
<span
|
||||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2"
|
||||
>{{ .Name | markdownify | emojify }}</span
|
||||
>
|
||||
{{ end }}
|
||||
</span>
|
||||
<span
|
||||
class="group-dark:hover:text-primary-400 hidden transition-colors group-hover:text-primary-600 dark:inline"
|
||||
title="{{ i18n "footer.light_appearance" }}"
|
||||
>
|
||||
{{ with .Params.icon | default "sun" }}
|
||||
{{- partial "icon.html" . -}}
|
||||
{{- end -}}
|
||||
{{- if .Params.showName | default true -}}
|
||||
<span
|
||||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2"
|
||||
>{{ .Name | markdownify | emojify }}</span
|
||||
>
|
||||
{{ end }}
|
||||
</span>
|
||||
</button>
|
||||
{{ else if eq .Params.action "locale" }}
|
||||
{{ $.Scratch.Add "localeCount" 1 }}
|
||||
{{ partial "translations.html" . }}
|
||||
{{ else }}
|
||||
<a
|
||||
href="{{ .URL }}"
|
||||
title="{{ .Title }}"
|
||||
onclick="close_menu()"
|
||||
{{ with .Params.target }}target="{{ . }}"{{ end }}
|
||||
>{{ with .Params.icon }}
|
||||
<span
|
||||
class="group-dark:hover:text-primary-400 transition-colors group-hover:text-primary-600"
|
||||
>
|
||||
{{- partial "icon.html" . -}}
|
||||
</span>
|
||||
{{- end -}}{{- if .Params.showName | default true -}}
|
||||
<span
|
||||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2"
|
||||
>{{ .Name | markdownify | emojify }}</span
|
||||
>
|
||||
{{ end }}</a
|
||||
>
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ if and ($.Site.Params.enableSearch | default false) (eq ($.Scratch.Get "searchCount") 0) }}
|
||||
<li class="group mb-1">
|
||||
<button id="search-button-m0" title="{{ i18n "search.open_button_title" }}">
|
||||
<span
|
||||
class="group-dark:hover:text-primary-400 transition-colors group-hover:text-primary-600"
|
||||
>
|
||||
{{ partial "icon.html" "search" }}
|
||||
</span>
|
||||
</button>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</label>
|
||||
{{/* Basic menu */}}
|
||||
<ul class="hidden list-none flex-row text-end sm:flex">
|
||||
{{ if .Site.Menus.main }}
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ if and (eq .Params.action "locale") (or (not page.IsTranslated) (not site.IsMultiLingual)) }}
|
||||
{{ continue }}
|
||||
{{ end }}
|
||||
<li class="group mb-1 sm:mb-0 sm:me-7 sm:last:me-0">
|
||||
{{ if eq .Params.action "search" }}
|
||||
{{ $.Scratch.Add "searchCount" 1 }}
|
||||
{{ if $.Site.Params.enableSearch | default false }}
|
||||
<button
|
||||
id="search-button-{{ $.Scratch.Get "searchCount" }}"
|
||||
title="{{ .Title | default (i18n "search.open_button_title") }}"
|
||||
>
|
||||
{{ with .Params.icon | default "search" }}
|
||||
<span
|
||||
class="group-dark:hover:text-primary-400 transition-colors group-hover:text-primary-600"
|
||||
>
|
||||
{{- partial "icon.html" . -}}
|
||||
</span>
|
||||
{{- end -}}{{- if .Params.showName | default true -}}
|
||||
<span
|
||||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2"
|
||||
>{{ .Name | markdownify | emojify }}</span
|
||||
>
|
||||
{{ end }}
|
||||
</button>
|
||||
{{ end }}
|
||||
{{ else if eq .Params.action "appearance" }}
|
||||
{{ $.Scratch.Add "switchCount" 1 }}
|
||||
<button
|
||||
id="appearance-switcher-{{ $.Scratch.Get "switchCount" }}"
|
||||
type="button"
|
||||
aria-label="appearance switcher"
|
||||
>
|
||||
<span
|
||||
class="group-dark:hover:text-primary-400 inline transition-colors group-hover:text-primary-600 dark:hidden"
|
||||
title="{{ i18n "footer.dark_appearance" }}"
|
||||
>
|
||||
{{ with .Params.icon | default "moon" }}
|
||||
{{- partial "icon.html" . -}}
|
||||
{{- end -}}
|
||||
{{- if .Params.showName | default true -}}
|
||||
<span
|
||||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2"
|
||||
>{{ .Name | markdownify | emojify }}</span
|
||||
>
|
||||
{{ end }}
|
||||
</span>
|
||||
<span
|
||||
class="group-dark:hover:text-primary-400 hidden transition-colors group-hover:text-primary-600 dark:inline"
|
||||
title="{{ i18n "footer.light_appearance" }}"
|
||||
>
|
||||
{{ with .Params.icon | default "sun" }}
|
||||
{{- partial "icon.html" . -}}
|
||||
{{- end -}}
|
||||
{{- if .Params.showName | default true -}}
|
||||
<span
|
||||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2"
|
||||
>{{ .Name | markdownify | emojify }}</span
|
||||
>
|
||||
{{ end }}
|
||||
</span>
|
||||
</button>
|
||||
{{ else if eq .Params.action "locale" }}
|
||||
{{ $.Scratch.Add "localeCount" 1 }}
|
||||
{{ partial "translations.html" . }}
|
||||
{{ else }}
|
||||
<a
|
||||
href="{{ .URL }}"
|
||||
title="{{ .Title }}"
|
||||
{{ with .Params.target }}target="{{ . }}"{{ end }}
|
||||
>{{ with .Params.icon }}
|
||||
<span
|
||||
class="group-dark:hover:text-primary-400 transition-colors group-hover:text-primary-600"
|
||||
>
|
||||
{{- partial "icon.html" . -}}
|
||||
</span>
|
||||
{{- end -}}{{- if .Params.showName | default true -}}
|
||||
<span
|
||||
class="decoration-primary-500 group-hover:underline group-hover:decoration-2 group-hover:underline-offset-2"
|
||||
>{{ .Name | markdownify | emojify }}</span
|
||||
>
|
||||
{{ end }}</a
|
||||
>
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ if and ($.Site.Params.enableSearch | default false) (eq ($.Scratch.Get "searchCount") 0) }}
|
||||
<li class="group mb-1 sm:mb-0 sm:me-7 sm:last:me-0">
|
||||
<button id="search-button-m1" title="{{ i18n "search.open_button_title" }}">
|
||||
<span
|
||||
class="group-dark:hover:text-primary-400 transition-colors group-hover:text-primary-600"
|
||||
>
|
||||
{{ partial "icon.html" "search" }}
|
||||
</span>
|
||||
</button>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</nav>
|
||||
</header>
|
||||
@@ -0,0 +1,5 @@
|
||||
<link rel="stylesheet" href="{{ "assets/css/custom.css" | relURL }}">
|
||||
<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=Share+Tech&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
||||
<script defer data-domain="it-services.trez.wtf" src="https://analytics.trez.wtf/js/script.js"></script>
|
||||
@@ -0,0 +1,34 @@
|
||||
{{- if .Site.Params.header.logo }}
|
||||
{{- $logo := resources.Get .Site.Params.header.logo }}
|
||||
{{- $logo_dark := resources.Get .Site.Params.header.logoDark }}
|
||||
{{- if $logo }}
|
||||
<a href="{{ "" | relLangURL }}" class="mr-2">
|
||||
<!-- prettier-ignore-attribute -->
|
||||
<img
|
||||
src="{{ $logo.RelPermalink }}"
|
||||
width="{{ div $logo.Width 2 }}"
|
||||
height="{{ div $logo.Height 2 }}"
|
||||
class="site-logo object-left
|
||||
{{ if $logo_dark }}hidden dark:flex{{ end }}"
|
||||
alt="{{ .Site.Title }}"
|
||||
/>
|
||||
{{- if $logo_dark }}
|
||||
<img
|
||||
src="{{ $logo_dark.RelPermalink }}"
|
||||
width="{{ div $logo_dark.Width 2 }}"
|
||||
height="{{ div $logo_dark.Height 2 }}"
|
||||
class="site-logo object-left dark:hidden"
|
||||
alt="{{ .Site.Title }}"
|
||||
/>
|
||||
{{- end }}
|
||||
</a>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Site.Params.header.showTitle | default true }}
|
||||
<a
|
||||
class="decoration-primary-500 hover:underline hover:decoration-2 hover:underline-offset-2"
|
||||
rel="me"
|
||||
href="{{ "" | relLangURL }}"
|
||||
>{{ .Site.Title | markdownify | emojify }}</a
|
||||
>
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user