From 79171f488cd15b75263779fffb48143061495fcd Mon Sep 17 00:00:00 2001
From: ZhenShuo Leo <98386542+ZhenShuo2021@users.noreply.github.com>
Date: Wed, 18 Jun 2025 19:36:46 +0800
Subject: [PATCH] refactor(header): modularize basic.html
---
layouts/partials/header/basic.html | 39 +++++++++++++++++++++---------
1 file changed, 28 insertions(+), 11 deletions(-)
diff --git a/layouts/partials/header/basic.html b/layouts/partials/header/basic.html
index 4572d3dc..9d28dad9 100644
--- a/layouts/partials/header/basic.html
+++ b/layouts/partials/header/basic.html
@@ -1,4 +1,5 @@
-
+{{/* Logo section */}}
+{{ define "HeaderLogo" }}
{{ if .Site.Params.Logo }}
{{ $logo := resources.Get .Site.Params.Logo }}
{{ if $logo }}
@@ -19,16 +20,10 @@
{{ end }}
{{- end }}
-
-
+{{/* Desktop navigation */}}
+{{ define "HeaderDesktopNavigation" }}
+{{ end }}
+
+{{/* Mobile navigation */}}
+{{ define "HeaderMobileNavigation" }}
@@ -89,7 +88,9 @@
{{ end }}
-
+{{ end }}
+
+{{ define "HeaderMobileMenu" }}
+ {{ template "HeaderLogo" . }}
+
+
+ {{ template "HeaderDesktopNavigation" . }}
+ {{ template "HeaderMobileNavigation" . }}
+
+ {{ template "HeaderMobileMenu" . }}
{{ if .Site.Menus.subnavigation }}