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.html
|
||||
layouts/partials/article-link/simple.html
|
||||
layouts/partials/header/basic.html
|
||||
layouts/partials/hero/background.html
|
||||
layouts/partials/head.html
|
||||
layouts/shortcodes/screenshot.html
|
||||
|
||||
@@ -6,16 +6,18 @@
|
||||
<div>
|
||||
<a href="{{ "" | relLangURL }}" class="flex">
|
||||
<span class="sr-only">{{ .Site.Title | markdownify }}</span>
|
||||
|
||||
{{ if eq $logo.MediaType.SubType "svg" }}
|
||||
<span class="logo object-scale-down object-left nozoom">
|
||||
{{ $logo.Content | safeHTML }}
|
||||
</span>
|
||||
{{ else }}
|
||||
<img 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 }}" />
|
||||
<img
|
||||
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 }}
|
||||
|
||||
</a>
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -25,7 +27,6 @@
|
||||
{{/* Desktop navigation */}}
|
||||
{{ define "HeaderDesktopNavigation" }}
|
||||
<nav class="hidden md:flex items-center gap-x-5 md:ml-12 h-12">
|
||||
|
||||
{{ if .Site.Menus.main }}
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ partial "header/header-option.html" . }}
|
||||
@@ -35,18 +36,22 @@
|
||||
{{ partial "translations.html" . }}
|
||||
|
||||
{{ 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" }}">
|
||||
{{ partial "icon.html" "search" }}
|
||||
</button>
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{/* Appearance switch */}}
|
||||
{{ if .Site.Params.footer.showAppearanceSwitcher | default false }}
|
||||
<div
|
||||
class="{{ if .Site.Params.footer.showScrollToTop | default true -}} {{- end }} flex items-center">
|
||||
<button id="appearance-switcher" aria-label="Dark mode switcher" type="button" class="text-base hover:text-primary-600 dark:hover:text-primary-400">
|
||||
<div class="{{ if .Site.Params.footer.showScrollToTop | default true -}}{{- end }} flex items-center">
|
||||
<button
|
||||
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">
|
||||
{{ partial "icon.html" "moon" }}
|
||||
</div>
|
||||
@@ -56,28 +61,31 @@
|
||||
</button>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
</nav>
|
||||
{{ end }}
|
||||
|
||||
{{/* Mobile navigation */}}
|
||||
{{ define "HeaderMobileNavigation" }}
|
||||
<div class="flex md:hidden items-center gap-x-5 md:ml-12 h-12">
|
||||
|
||||
<span></span>
|
||||
|
||||
{{ partial "translations.html" . }}
|
||||
|
||||
{{ 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" }}">
|
||||
{{ partial "icon.html" "search" }}
|
||||
</button>
|
||||
{{ end }}
|
||||
|
||||
{{/* Appearance switch */}}
|
||||
{{ 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">
|
||||
{{ partial "icon.html" "moon" }}
|
||||
</div>
|
||||
@@ -86,34 +94,30 @@
|
||||
</div>
|
||||
</button>
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ define "HeaderMobileMenu" }}
|
||||
<div class="-my-2 md:hidden">
|
||||
|
||||
<label id="menu-button" class="block">
|
||||
{{ if .Site.Menus.main }}
|
||||
<div class="cursor-pointer hover:text-primary-600 dark:hover:text-primary-400">
|
||||
{{ partial "icon.html" "bars" }}
|
||||
</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
|
||||
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">
|
||||
<span
|
||||
class="cursor-pointer inline-block align-text-bottom hover:text-primary-600 dark:hover:text-primary-400">{{
|
||||
partial
|
||||
"icon.html"
|
||||
"xmark" }}</span>
|
||||
class="cursor-pointer inline-block align-text-bottom hover:text-primary-600 dark:hover:text-primary-400">
|
||||
{{ partial "icon.html" "xmark" }}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
{{ range .Site.Menus.main }}
|
||||
|
||||
{{ partial "header/header-mobile-option.html" . }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
</ul>
|
||||
@@ -121,12 +125,14 @@
|
||||
<hr>
|
||||
<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">
|
||||
|
||||
|
||||
{{ range .Site.Menus.subnavigation }}
|
||||
<li class="mb-1">
|
||||
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:"
|
||||
) }} target="_blank" {{ end }} class="flex items-center">
|
||||
<a
|
||||
href="{{ .URL }}"
|
||||
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:") }}
|
||||
target="_blank"
|
||||
{{ end }}
|
||||
class="flex items-center">
|
||||
{{ if .Pre }}
|
||||
<span {{ if and .Pre .Name }}class="mr-3"{{ end }}>
|
||||
{{ partial "icon.html" .Pre }}
|
||||
@@ -138,24 +144,24 @@
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
{{ end }}
|
||||
</label>
|
||||
</div>
|
||||
{{ 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" . }}
|
||||
<div class="flex flex-1 items-center justify-between">
|
||||
<nav class="flex space-x-3">
|
||||
{{ if not .Site.Params.disableTextInHeader | default true }}
|
||||
<a href="{{ "" | relLangURL }}" class="text-base font-medium text-gray-500 hover:text-gray-900">{{
|
||||
.Site.Title | markdownify
|
||||
}}</a>
|
||||
<a href="{{ "" | relLangURL }}" class="text-base font-medium text-gray-500 hover:text-gray-900">
|
||||
{{ .Site.Title | markdownify }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
{{ template "HeaderDesktopNavigation" . }}
|
||||
@@ -165,11 +171,17 @@
|
||||
</div>
|
||||
|
||||
{{ 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">
|
||||
{{ range .Site.Menus.subnavigation }}
|
||||
<a href="{{ .URL }}" {{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
|
||||
target="_blank" {{ end }} class="flex items-center">
|
||||
<a
|
||||
href="{{ .URL }}"
|
||||
{{ if or (strings.HasPrefix .URL "http:" ) (strings.HasPrefix .URL "https:" ) }}
|
||||
target="_blank"
|
||||
{{ end }}
|
||||
class="flex items-center">
|
||||
{{ if .Pre }}
|
||||
<span {{ if and .Pre .Name }}class="mr-1"{{ end }}>
|
||||
{{ partial "icon.html" .Pre }}
|
||||
@@ -187,10 +199,10 @@
|
||||
{{ if .Site.Params.highlightCurrentMenuArea }}
|
||||
<script>
|
||||
(function () {
|
||||
var $mainmenu = $('.main-menu');
|
||||
var $mainmenu = $(".main-menu");
|
||||
var path = window.location.pathname;
|
||||
$mainmenu.find('a[href="' + path + '"]').each(function (i, e) {
|
||||
$(e).children('p').addClass('active');
|
||||
$(e).children("p").addClass("active");
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user