Browse Source

feat: added auto expand mobile page navigation

Ralph Ocdol 8 months ago
parent
commit
33dede8abc
2 changed files with 10 additions and 9 deletions
  1. 1 1
      internal/assets/templates/page.html
  2. 9 8
      internal/glance/glance.go

+ 1 - 1
internal/assets/templates/page.html

@@ -46,7 +46,7 @@
             {{ range $i, $column := .Page.Columns }}
             <label class="mobile-navigation-label"><input type="radio" class="mobile-navigation-input" name="column" value="{{ $i }}" autocomplete="off"{{ if eq "full" $column.Size }} checked{{ end }}><div class="mobile-navigation-pill"></div></label>
             {{ end }}
-            <label class="mobile-navigation-label"><input type="checkbox" class="mobile-navigation-page-links-input" autocomplete="on"><div class="hamburger-icon"></div></label>
+            <label class="mobile-navigation-label"><input type="checkbox" class="mobile-navigation-page-links-input" autocomplete="on"{{ if .Page.ExpandMobilePageNavigation }} checked{{ end }}><div class="hamburger-icon"></div></label>
         </div>
         <div class="mobile-navigation-page-links">
             {{ template "navigation-links" . }}

+ 9 - 8
internal/glance/glance.go

@@ -68,14 +68,15 @@ type templateData struct {
 }
 
 type Page struct {
-	Title                 string   `yaml:"name"`
-	Slug                  string   `yaml:"slug"`
-	Width                 string   `yaml:"width"`
-	ShowMobileHeader      bool     `yaml:"show-mobile-header"`
-	HideDesktopNavigation bool     `yaml:"hide-desktop-navigation"`
-	CenterVertically      bool     `yaml:"center-vertically"`
-	Columns               []Column `yaml:"columns"`
-	mu                    sync.Mutex
+	Title                       string   `yaml:"name"`
+	Slug                        string   `yaml:"slug"`
+	Width                       string   `yaml:"width"`
+	ShowMobileHeader            bool     `yaml:"show-mobile-header"`
+	ExpandMobilePageNavigation  bool	 `yaml:"expand-mobile-page-navigation"`
+	HideDesktopNavigation       bool     `yaml:"hide-desktop-navigation"`
+	CenterVertically            bool     `yaml:"center-vertically"`
+	Columns                     []Column `yaml:"columns"`
+	mu                          sync.Mutex
 }
 
 func (p *Page) UpdateOutdatedWidgets() {