From 1d743646c591832497f1bf897545cd154f67279a Mon Sep 17 00:00:00 2001 From: Iris Lightshard Date: Sat, 16 Mar 2024 23:42:53 -0600 Subject: [PATCH] add favicon and put NAVIGATION first in page list --- LICENSE | 2 +- archetype/eureka.go | 7 ++++--- static/favicon.png | Bin 0 -> 653 bytes templates/cms_list.html | 7 +++++++ templates/header.html | 3 ++- 5 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 static/favicon.png diff --git a/LICENSE b/LICENSE index 9614d19..139e89d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2022 Derek Stevens +Copyright 2024 Iris LIghtshard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/archetype/eureka.go b/archetype/eureka.go index 4bfb2d0..5486b7e 100644 --- a/archetype/eureka.go +++ b/archetype/eureka.go @@ -77,9 +77,10 @@ func (self *EurekaAdapter) ListPages() map[string]string { } pages := map[string]string{} + pages["meta.nav.htm"] = "NAVIGATION" for _, file := range files { filename := file.Name() - if strings.HasSuffix(filename, ".htm") { + if strings.HasSuffix(filename, ".htm") && filename != "meta.nav.htm" { pages[filename] = strings.Replace( strings.TrimSuffix(filename, ".htm"), "_", " ", -1) } @@ -195,7 +196,7 @@ func (self *EurekaAdapter) FormattingHelp() string { func (self *EurekaAdapter) CreatePage(slug, title, content string) error { // eureka creates titles from slugs, so we transform the title into the slug - slug = strings.ReplaceAll(title, " ", "_") + ".htm" + slug = strings.ToLower(strings.ReplaceAll(title, " ", "_")) + ".htm" path := filepath.Join(self.Root, "inc", slug) if strings.Contains(slug, "../") || strings.Contains(slug, "..\\") { @@ -217,7 +218,7 @@ func (self *EurekaAdapter) CreatePage(slug, title, content string) error { func (self *EurekaAdapter) SavePage(oldSlug, newSlug, title, content string) error { // eureka creates titles from slugs, so we transform the title into the slug - newSlug = strings.ReplaceAll(title, " ", "_") + ".htm" + newSlug = strings.ToLower(strings.ReplaceAll(title, " ", "_")) + ".htm" if strings.Contains(newSlug, "../") || strings.Contains(newSlug, "..\\") || strings.Contains(oldSlug, "../") || strings.Contains(oldSlug, "..\\") { diff --git a/static/favicon.png b/static/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..87a844b32160d6c6fa57a1961678496ecc295f40 GIT binary patch literal 653 zcmV;80&@L{P)EX>4Tx04R}tkv&MmKpe$ilZql05j%)DWT;LSL`58H6^c+H)C#RSm|Xe=O&XFE z7e~Rh;NZt%)xpJCR|i)?5c~jfc5qU3krMxx7Fxu3aNLh~_a1le0HI!Hx*d!Gy5U%< zL|n>bSEcS(h!{W+6A%?UT9?#W*m${8!mT&FpL1QxLb84^@fQ9>CGqO=;M*htZS+{Zuc`DJpc&10HMuF~Kpiy((?_<|(oB-l8aAmapl{zr{NqViV zMUH^}ZQ$a%t*Lv!@;4RR**6gjdkJASrOwl!Ur00006VoOIv0RI600RN!9r;`8x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru=mQZ24h3=KVvhg-02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{003o4L_t(o!(%*r`0#%QGJ#}ZB~j|0uW!dG$HXweVCXu4 z8o@sr1w+>X)QbPnC>WX!pl1A!M#0c?0JY literal 0 HcmV?d00001 diff --git a/templates/cms_list.html b/templates/cms_list.html index e0cf286..d84c5ce 100644 --- a/templates/cms_list.html +++ b/templates/cms_list.html @@ -11,7 +11,14 @@
    {{ range $slug, $title := $pages }} + {{ if eq $title "NAVIGATION" }}
  • {{$title}}
  • + {{ end }} + {{ end }} + {{ range $slug, $title := $pages }} + {{ if ne $title "NAVIGATION" }} +
  • {{$title}}
  • + {{ end }} {{ end }}
diff --git a/templates/header.html b/templates/header.html index 66750c0..e6c6c33 100644 --- a/templates/header.html +++ b/templates/header.html @@ -6,6 +6,7 @@ + Nirvash — CMS @@ -20,4 +21,4 @@
  • Logout
  • -{{end}} \ No newline at end of file +{{end}}