mirror of
https://github.com/nunocoracao/blowfish.git
synced 2026-01-30 16:31:52 +01:00
style(header): run prettier format
This commit is contained in:
@@ -31,7 +31,6 @@ layouts/_default/list.html
|
|||||||
layouts/partials/article-link/card-related.html
|
layouts/partials/article-link/card-related.html
|
||||||
layouts/partials/article-link/card.html
|
layouts/partials/article-link/card.html
|
||||||
layouts/partials/article-link/simple.html
|
layouts/partials/article-link/simple.html
|
||||||
layouts/partials/header/basic.html
|
|
||||||
layouts/partials/hero/background.html
|
layouts/partials/hero/background.html
|
||||||
layouts/partials/head.html
|
layouts/partials/head.html
|
||||||
layouts/shortcodes/screenshot.html
|
layouts/shortcodes/screenshot.html
|
||||||
|
|||||||
@@ -6,16 +6,18 @@
|
|||||||
<div>
|
<div>
|
||||||
<a href="{{ "" | relLangURL }}" class="flex">
|
<a href="{{ "" | relLangURL }}" class="flex">
|
||||||
<span class="sr-only">{{ .Site.Title | markdownify }}</span>
|
<span class="sr-only">{{ .Site.Title | markdownify }}</span>
|
||||||
|
|
||||||
{{ if eq $logo.MediaType.SubType "svg" }}
|
{{ if eq $logo.MediaType.SubType "svg" }}
|
||||||
<span class="logo object-scale-down object-left nozoom">
|
<span class="logo object-scale-down object-left nozoom">
|
||||||
{{ $logo.Content | safeHTML }}
|
{{ $logo.Content | safeHTML }}
|
||||||
</span>
|
</span>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<img src="{{ $logo.RelPermalink }}" width="{{ div $logo.Width 2 }}" height="{{ div $logo.Height 2 }}"
|
<img
|
||||||
class="logo max-h-[5rem] max-w-[5rem] object-scale-down object-left nozoom" alt="{{ .Site.Title }}" />
|
src="{{ $logo.RelPermalink }}"
|
||||||
|
width="{{ div $logo.Width 2 }}"
|
||||||
|
height="{{ div $logo.Height 2 }}"
|
||||||
|
class="logo max-h-[5rem] max-w-[5rem] object-scale-down object-left nozoom"
|
||||||
|
alt="{{ .Site.Title }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@@ -25,7 +27,6 @@
|
|||||||
{{/* Desktop navigation */}}
|
{{/* Desktop navigation */}}
|
||||||
{{ define "HeaderDesktopNavigation" }}
|
{{ define "HeaderDesktopNavigation" }}
|
||||||
<nav class="hidden md:flex items-center gap-x-5 md:ml-12 h-12">
|
<nav class="hidden md:flex items-center gap-x-5 md:ml-12 h-12">
|
||||||
|
|
||||||
{{ if .Site.Menus.main }}
|
{{ if .Site.Menus.main }}
|
||||||
{{ range .Site.Menus.main }}
|
{{ range .Site.Menus.main }}
|
||||||
{{ partial "header/header-option.html" . }}
|
{{ partial "header/header-option.html" . }}
|
||||||
@@ -35,18 +36,22 @@
|
|||||||
{{ partial "translations.html" . }}
|
{{ partial "translations.html" . }}
|
||||||
|
|
||||||
{{ if .Site.Params.enableSearch | default false }}
|
{{ if .Site.Params.enableSearch | default false }}
|
||||||
<button id="search-button" aria-label="Search" class="text-base hover:text-primary-600 dark:hover:text-primary-400"
|
<button
|
||||||
|
id="search-button"
|
||||||
|
aria-label="Search"
|
||||||
|
class="text-base hover:text-primary-600 dark:hover:text-primary-400"
|
||||||
title="{{ i18n " search.open_button_title" }}">
|
title="{{ i18n " search.open_button_title" }}">
|
||||||
{{ partial "icon.html" "search" }}
|
{{ partial "icon.html" "search" }}
|
||||||
</button>
|
</button>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
{{/* Appearance switch */}}
|
|
||||||
{{ if .Site.Params.footer.showAppearanceSwitcher | default false }}
|
{{ if .Site.Params.footer.showAppearanceSwitcher | default false }}
|
||||||
<div
|
<div class="{{ if .Site.Params.footer.showScrollToTop | default true -}}{{- end }} flex items-center">
|
||||||
class="{{ if .Site.Params.footer.showScrollToTop | default true -}} {{- end }} flex items-center">
|
<button
|
||||||
<button id="appearance-switcher" aria-label="Dark mode switcher" type="button" class="text-base hover:text-primary-600 dark:hover:text-primary-400">
|
id="appearance-switcher"
|
||||||
|
aria-label="Dark mode switcher"
|
||||||
|
type="button"
|
||||||
|
class="text-base hover:text-primary-600 dark:hover:text-primary-400">
|
||||||
<div class="flex items-center justify-center dark:hidden">
|
<div class="flex items-center justify-center dark:hidden">
|
||||||
{{ partial "icon.html" "moon" }}
|
{{ partial "icon.html" "moon" }}
|
||||||
</div>
|
</div>
|
||||||
@@ -56,28 +61,31 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{/* Mobile navigation */}}
|
{{/* Mobile navigation */}}
|
||||||
{{ define "HeaderMobileNavigation" }}
|
{{ define "HeaderMobileNavigation" }}
|
||||||
<div class="flex md:hidden items-center gap-x-5 md:ml-12 h-12">
|
<div class="flex md:hidden items-center gap-x-5 md:ml-12 h-12">
|
||||||
|
|
||||||
<span></span>
|
<span></span>
|
||||||
|
|
||||||
{{ partial "translations.html" . }}
|
{{ partial "translations.html" . }}
|
||||||
|
|
||||||
{{ if .Site.Params.enableSearch | default false }}
|
{{ if .Site.Params.enableSearch | default false }}
|
||||||
<button id="search-button-mobile" aria-label="Search" class="text-base hover:text-primary-600 dark:hover:text-primary-400"
|
<button
|
||||||
|
id="search-button-mobile"
|
||||||
|
aria-label="Search"
|
||||||
|
class="text-base hover:text-primary-600 dark:hover:text-primary-400"
|
||||||
title="{{ i18n " search.open_button_title" }}">
|
title="{{ i18n " search.open_button_title" }}">
|
||||||
{{ partial "icon.html" "search" }}
|
{{ partial "icon.html" "search" }}
|
||||||
</button>
|
</button>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{/* Appearance switch */}}
|
|
||||||
{{ if .Site.Params.footer.showAppearanceSwitcher | default false }}
|
{{ if .Site.Params.footer.showAppearanceSwitcher | default false }}
|
||||||
<button id="appearance-switcher-mobile" aria-label="Dark mode switcher" type="button" class="text-base hover:text-primary-600 dark:hover:text-primary-400 ltr:mr-1 rtl:ml-1">
|
<button
|
||||||
|
id="appearance-switcher-mobile"
|
||||||
|
aria-label="Dark mode switcher"
|
||||||
|
type="button"
|
||||||
|
class="text-base hover:text-primary-600 dark:hover:text-primary-400 ltr:mr-1 rtl:ml-1">
|
||||||
<div class="flex items-center justify-center dark:hidden">
|
<div class="flex items-center justify-center dark:hidden">
|
||||||
{{ partial "icon.html" "moon" }}
|
{{ partial "icon.html" "moon" }}
|
||||||
</div>
|
</div>
|
||||||
@@ -86,34 +94,30 @@
|
|||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ define "HeaderMobileMenu" }}
|
{{ define "HeaderMobileMenu" }}
|
||||||
<div class="-my-2 md:hidden">
|
<div class="-my-2 md:hidden">
|
||||||
|
|
||||||
<label id="menu-button" class="block">
|
<label id="menu-button" class="block">
|
||||||
{{ if .Site.Menus.main }}
|
{{ if .Site.Menus.main }}
|
||||||
<div class="cursor-pointer hover:text-primary-600 dark:hover:text-primary-400">
|
<div class="cursor-pointer hover:text-primary-600 dark:hover:text-primary-400">
|
||||||
{{ partial "icon.html" "bars" }}
|
{{ partial "icon.html" "bars" }}
|
||||||
</div>
|
</div>
|
||||||
<div id="menu-wrapper" class="fixed inset-0 z-30 invisible w-screen h-screen m-0 overflow-auto transition-opacity opacity-0 cursor-default bg-neutral-100/50 backdrop-blur-sm dark:bg-neutral-900/50 padding-top-[5px]">
|
<div
|
||||||
|
id="menu-wrapper"
|
||||||
|
class="fixed inset-0 z-30 invisible w-screen h-screen m-0 overflow-auto transition-opacity opacity-0 cursor-default bg-neutral-100/50 backdrop-blur-sm dark:bg-neutral-900/50 padding-top-[5px]">
|
||||||
<ul
|
<ul
|
||||||
class="flex space-y-2 mt-3 flex-col items-end w-full px-6 py-6 mx-auto overflow-visible list-none ltr:text-right rtl:text-left max-w-7xl">
|
class="flex space-y-2 mt-3 flex-col items-end w-full px-6 py-6 mx-auto overflow-visible list-none ltr:text-right rtl:text-left max-w-7xl">
|
||||||
|
|
||||||
<li id="menu-close-button">
|
<li id="menu-close-button">
|
||||||
<span
|
<span
|
||||||
class="cursor-pointer inline-block align-text-bottom hover:text-primary-600 dark:hover:text-primary-400">{{
|
class="cursor-pointer inline-block align-text-bottom hover:text-primary-600 dark:hover:text-primary-400">
|
||||||
partial
|
{{ partial "icon.html" "xmark" }}
|
||||||
"icon.html"
|
</span>
|
||||||
"xmark" }}</span>
|
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{{ range .Site.Menus.main }}
|
{{ range .Site.Menus.main }}
|
||||||
|
|
||||||
{{ partial "header/header-mobile-option.html" . }}
|
{{ partial "header/header-mobile-option.html" . }}
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
@@ -121,14 +125,16 @@
|
|||||||
<hr>
|
<hr>
|
||||||
<ul
|
<ul
|
||||||
class="flex mt-4 flex-col items-end w-full px-6 py-6 mx-auto overflow-visible list-none ltr:text-right rtl:text-left max-w-7xl">
|
class="flex mt-4 flex-col items-end w-full px-6 py-6 mx-auto overflow-visible list-none ltr:text-right rtl:text-left max-w-7xl">
|
||||||
|
|
||||||
|
|
||||||
{{ range .Site.Menus.subnavigation }}
|
{{ range .Site.Menus.subnavigation }}
|
||||||
<li class="mb-1">
|
<li class="mb-1">
|
||||||
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:"
|
<a
|
||||||
) }} target="_blank" {{ end }} class="flex items-center">
|
href="{{ .URL }}"
|
||||||
|
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:") }}
|
||||||
|
target="_blank"
|
||||||
|
{{ end }}
|
||||||
|
class="flex items-center">
|
||||||
{{ if .Pre }}
|
{{ if .Pre }}
|
||||||
<span {{ if and .Pre .Name}} class="mr-3" {{ end }}>
|
<span {{ if and .Pre .Name }}class="mr-3"{{ end }}>
|
||||||
{{ partial "icon.html" .Pre }}
|
{{ partial "icon.html" .Pre }}
|
||||||
</span>
|
</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@@ -138,24 +144,24 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<div class="main-menu flex items-center justify-between px-4 py-6 sm:px-6 md:justify-start gap-x-3 padding-main-menu">
|
{{/* ========== Render HTML ========== */}}
|
||||||
|
<div
|
||||||
|
class="main-menu flex items-center justify-between px-4 py-6 sm:px-6 md:justify-start gap-x-3 padding-main-menu">
|
||||||
{{ template "HeaderLogo" . }}
|
{{ template "HeaderLogo" . }}
|
||||||
<div class="flex flex-1 items-center justify-between">
|
<div class="flex flex-1 items-center justify-between">
|
||||||
<nav class="flex space-x-3">
|
<nav class="flex space-x-3">
|
||||||
{{ if not .Site.Params.disableTextInHeader | default true }}
|
{{ if not .Site.Params.disableTextInHeader | default true }}
|
||||||
<a href="{{ "" | relLangURL }}" class="text-base font-medium text-gray-500 hover:text-gray-900">{{
|
<a href="{{ "" | relLangURL }}" class="text-base font-medium text-gray-500 hover:text-gray-900">
|
||||||
.Site.Title | markdownify
|
{{ .Site.Title | markdownify }}
|
||||||
}}</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</nav>
|
</nav>
|
||||||
{{ template "HeaderDesktopNavigation" . }}
|
{{ template "HeaderDesktopNavigation" . }}
|
||||||
@@ -165,13 +171,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ if .Site.Menus.subnavigation }}
|
{{ if .Site.Menus.subnavigation }}
|
||||||
<div class="main-menu flex pb-3 flex-col items-end justify-between md:justify-start space-x-3{{ if .Site.Params.Logo }} margin-top-[-15px]{{ end }}">
|
<div
|
||||||
|
class="main-menu flex pb-3 flex-col items-end justify-between md:justify-start space-x-3
|
||||||
|
{{ if .Site.Params.Logo }}margin-top-[-15px]{{ end }}">
|
||||||
<div class="hidden md:flex items-center space-x-5">
|
<div class="hidden md:flex items-center space-x-5">
|
||||||
{{ range .Site.Menus.subnavigation }}
|
{{ range .Site.Menus.subnavigation }}
|
||||||
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
|
<a
|
||||||
target="_blank" {{ end }} class="flex items-center">
|
href="{{ .URL }}"
|
||||||
|
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
|
||||||
|
target="_blank"
|
||||||
|
{{ end }}
|
||||||
|
class="flex items-center">
|
||||||
{{ if .Pre }}
|
{{ if .Pre }}
|
||||||
<span {{ if and .Pre .Name}} class="mr-1" {{ end }}>
|
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
|
||||||
{{ partial "icon.html" .Pre }}
|
{{ partial "icon.html" .Pre }}
|
||||||
</span>
|
</span>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@@ -181,17 +193,17 @@
|
|||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if .Site.Params.highlightCurrentMenuArea }}
|
{{ if .Site.Params.highlightCurrentMenuArea }}
|
||||||
<script>
|
<script>
|
||||||
(function () {
|
(function () {
|
||||||
var $mainmenu = $('.main-menu');
|
var $mainmenu = $(".main-menu");
|
||||||
var path = window.location.pathname;
|
var path = window.location.pathname;
|
||||||
$mainmenu.find('a[href="' + path + '"]').each(function (i, e) {
|
$mainmenu.find('a[href="' + path + '"]').each(function (i, e) {
|
||||||
$(e).children('p').addClass('active');
|
$(e).children("p").addClass("active");
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|||||||
Reference in New Issue
Block a user