add favicon and put NAVIGATION first in page list
This commit is contained in:
parent
e4ae62ad7b
commit
1d743646c5
5 changed files with 14 additions and 5 deletions
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
|||
Copyright 2022 Derek Stevens <nilix@nilfm.cc>
|
||||
Copyright 2024 Iris LIghtshard <nilix@nilfm.cc>
|
||||
|
||||
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:
|
||||
|
||||
|
|
|
@ -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, "..\\") {
|
||||
|
|
BIN
static/favicon.png
Normal file
BIN
static/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 653 B |
|
@ -11,8 +11,15 @@
|
|||
<div class="page-list">
|
||||
<ul>
|
||||
{{ range $slug, $title := $pages }}
|
||||
{{ if eq $title "NAVIGATION" }}
|
||||
<li><a href="/edit/{{$slug}}">{{$title}}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ range $slug, $title := $pages }}
|
||||
{{ if ne $title "NAVIGATION" }}
|
||||
<li><a href="/edit/{{$slug}}">{{$title}}</a></li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<meta name='description' content='Nirvash CMS'/>
|
||||
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
||||
<link rel='stylesheet' type='text/css' href='/static/style.css'>
|
||||
<link rel='shortcut icon' href='/static/favicon.png'>
|
||||
<title>Nirvash — CMS</title>
|
||||
</head>
|
||||
<body>
|
||||
|
|
Loading…
Reference in a new issue