Make hypha names case and space insensitive (testing to be done)
@ -38,12 +38,10 @@ func InitConfig(wd string) bool {
|
|||||||
|
|
||||||
if _, err := os.Stat(configJsonPath); os.IsNotExist(err) {
|
if _, err := os.Stat(configJsonPath); os.IsNotExist(err) {
|
||||||
log.Println("config.json not found, using default values")
|
log.Println("config.json not found, using default values")
|
||||||
} else {
|
return false
|
||||||
log.Println("config.json found, overriding default values...")
|
|
||||||
return readConfig()
|
|
||||||
}
|
}
|
||||||
|
log.Println("config.json found, overriding default values...")
|
||||||
return true
|
return readConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
func readConfig() bool {
|
func readConfig() bool {
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/bouncepaw/mycorrhiza/cfg"
|
"github.com/bouncepaw/mycorrhiza/cfg"
|
||||||
|
"github.com/bouncepaw/mycorrhiza/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (h *Hypha) MetaJsonPath() string {
|
func (h *Hypha) MetaJsonPath() string {
|
||||||
@ -17,7 +18,7 @@ func (h *Hypha) MetaJsonPath() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *Hypha) Path() string {
|
func (h *Hypha) Path() string {
|
||||||
return filepath.Join(cfg.WikiDir, h.FullName)
|
return filepath.Join(cfg.WikiDir, util.UrlToCanonical(h.FullName))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Hypha) TextPath() string {
|
func (h *Hypha) TextPath() string {
|
||||||
@ -25,7 +26,7 @@ func (h *Hypha) TextPath() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *Hypha) parentName() string {
|
func (h *Hypha) parentName() string {
|
||||||
return filepath.Dir(h.FullName)
|
return filepath.Dir(util.UrlToCanonical(h.FullName))
|
||||||
}
|
}
|
||||||
|
|
||||||
// hasBinaryData returns true if the revision has any binary data associated.
|
// hasBinaryData returns true if the revision has any binary data associated.
|
||||||
|
3
fs/fs.go
@ -54,6 +54,3 @@ func (s *Storage) indexHyphae(path string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Hypha) Close() {
|
|
||||||
}
|
|
||||||
|
@ -6,6 +6,8 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/bouncepaw/mycorrhiza/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *Storage) RenderHypha(h *Hypha) {
|
func (s *Storage) RenderHypha(h *Hypha) {
|
||||||
@ -24,6 +26,7 @@ type Tree struct {
|
|||||||
// It can also generate trees for non-existent hyphae, that's why we use `name string` instead of making it a method on `Hypha`.
|
// It can also generate trees for non-existent hyphae, that's why we use `name string` instead of making it a method on `Hypha`.
|
||||||
// In `root` is `false`, siblings will not be fetched.
|
// In `root` is `false`, siblings will not be fetched.
|
||||||
func (s *Storage) GetTree(name string, root bool) *Tree {
|
func (s *Storage) GetTree(name string, root bool) *Tree {
|
||||||
|
name = util.UrlToCanonical(name)
|
||||||
t := &Tree{Name: name, Root: root}
|
t := &Tree{Name: name, Root: root}
|
||||||
for hyphaName, _ := range s.paths {
|
for hyphaName, _ := range s.paths {
|
||||||
s.compareNamesAndAppend(t, hyphaName)
|
s.compareNamesAndAppend(t, hyphaName)
|
||||||
@ -65,14 +68,14 @@ func (t *Tree) AsHtml() (html string) {
|
|||||||
html += `<ul class="navitree__node">`
|
html += `<ul class="navitree__node">`
|
||||||
if t.Root {
|
if t.Root {
|
||||||
for _, ancestor := range t.Ancestors {
|
for _, ancestor := range t.Ancestors {
|
||||||
html += navitreeEntry(ancestor, "navitree__ancestor")
|
html += navitreeEntry(util.CanonicalToDisplay(ancestor), "navitree__ancestor")
|
||||||
}
|
}
|
||||||
for _, siblingName := range t.Siblings {
|
for _, siblingName := range t.Siblings {
|
||||||
html += navitreeEntry(siblingName, "navitree__sibling")
|
html += navitreeEntry(util.CanonicalToDisplay(siblingName), "navitree__sibling")
|
||||||
}
|
}
|
||||||
html += navitreeEntry(t.Name, "navitree__pagename")
|
html += navitreeEntry(util.CanonicalToDisplay(t.Name), "navitree__pagename")
|
||||||
} else {
|
} else {
|
||||||
html += navitreeEntry(t.Name, "navitree__name")
|
html += navitreeEntry(util.CanonicalToDisplay(t.Name), "navitree__name")
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, subtree := range t.Descendants {
|
for _, subtree := range t.Descendants {
|
||||||
@ -89,5 +92,5 @@ func navitreeEntry(name, class string) string {
|
|||||||
return fmt.Sprintf(`<li class="navitree__entry %s">
|
return fmt.Sprintf(`<li class="navitree__entry %s">
|
||||||
<a class="navitree__link" href="/%s">%s</a>
|
<a class="navitree__link" href="/%s">%s</a>
|
||||||
</li>
|
</li>
|
||||||
`, class, name, filepath.Base(name))
|
`, class, util.DisplayToCanonical(name), filepath.Base(name))
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
|
"github.com/bouncepaw/mycorrhiza/util"
|
||||||
"gopkg.in/russross/blackfriday.v2"
|
"gopkg.in/russross/blackfriday.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -20,7 +21,7 @@ func (h *Hypha) asHtml() (string, error) {
|
|||||||
`
|
`
|
||||||
// What about using <figure>?
|
// What about using <figure>?
|
||||||
if h.hasBinaryData() {
|
if h.hasBinaryData() {
|
||||||
ret += fmt.Sprintf(`<img src="/%s?action=binary&rev=%d" class="page__amnt"/>`, rev.FullName, rev.Id)
|
ret += fmt.Sprintf(`<img src="/%s?action=binary&rev=%d" class="page__amnt"/>`, util.DisplayToCanonical(rev.FullName), rev.Id)
|
||||||
}
|
}
|
||||||
|
|
||||||
contents, err := ioutil.ReadFile(rev.TextPath)
|
contents, err := ioutil.ReadFile(rev.TextPath)
|
||||||
|
@ -13,6 +13,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/bouncepaw/mycorrhiza/cfg"
|
"github.com/bouncepaw/mycorrhiza/cfg"
|
||||||
|
"github.com/bouncepaw/mycorrhiza/util"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Hypha struct {
|
type Hypha struct {
|
||||||
@ -33,9 +34,10 @@ func (h *Hypha) Invalidate(err error) *Hypha {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Storage) Open(name string) *Hypha {
|
func (s *Storage) Open(name string) *Hypha {
|
||||||
|
name = util.UrlToCanonical(name)
|
||||||
h := &Hypha{
|
h := &Hypha{
|
||||||
Exists: true,
|
Exists: true,
|
||||||
FullName: name,
|
FullName: util.CanonicalToDisplay(name),
|
||||||
}
|
}
|
||||||
path, ok := s.paths[name]
|
path, ok := s.paths[name]
|
||||||
// This hypha does not exist yet
|
// This hypha does not exist yet
|
||||||
|
@ -29,7 +29,7 @@ func HyphaEdit(h *fs.Hypha) []byte { //
|
|||||||
|
|
||||||
// HyphaUpdateOk is used to inform that update was successful.
|
// HyphaUpdateOk is used to inform that update was successful.
|
||||||
func HyphaUpdateOk(h *fs.Hypha) []byte { //
|
func HyphaUpdateOk(h *fs.Hypha) []byte { //
|
||||||
return layout("updateOk").
|
return layout("update_ok").
|
||||||
withMap(map[string]string{"Name": h.FullName}).
|
withMap(map[string]string{"Name": h.FullName}).
|
||||||
Bytes()
|
Bytes()
|
||||||
}
|
}
|
||||||
@ -56,6 +56,9 @@ func hyphaGeneric(name, content, templateName string) []byte {
|
|||||||
|
|
||||||
// wrapInBase is used to wrap layouts in things that are present on all pages.
|
// wrapInBase is used to wrap layouts in things that are present on all pages.
|
||||||
func (lyt *Layout) wrapInBase(keys map[string]string) []byte {
|
func (lyt *Layout) wrapInBase(keys map[string]string) []byte {
|
||||||
|
if lyt.invalid {
|
||||||
|
return lyt.Bytes()
|
||||||
|
}
|
||||||
page := map[string]string{
|
page := map[string]string{
|
||||||
"Title": cfg.SiteTitle,
|
"Title": cfg.SiteTitle,
|
||||||
"Main": "",
|
"Main": "",
|
||||||
|
33
util/util.go
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package util
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
"unicode"
|
||||||
|
)
|
||||||
|
|
||||||
|
func UrlToCanonical(name string) string {
|
||||||
|
return strings.ToLower(strings.ReplaceAll(name, " ", "_"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func DisplayToCanonical(name string) string {
|
||||||
|
return strings.ToLower(strings.ReplaceAll(name, " ", "_"))
|
||||||
|
}
|
||||||
|
|
||||||
|
func CanonicalToDisplay(name string) (res string) {
|
||||||
|
tmp := strings.Title(name)
|
||||||
|
var afterPoint bool
|
||||||
|
for _, ch := range tmp {
|
||||||
|
if afterPoint {
|
||||||
|
afterPoint = false
|
||||||
|
ch = unicode.ToLower(ch)
|
||||||
|
}
|
||||||
|
switch ch {
|
||||||
|
case '.':
|
||||||
|
afterPoint = true
|
||||||
|
case '_':
|
||||||
|
ch = ' '
|
||||||
|
}
|
||||||
|
res += string(ch)
|
||||||
|
}
|
||||||
|
return res
|
||||||
|
}
|
@ -1,11 +0,0 @@
|
|||||||
<div class="naviwrapper">
|
|
||||||
<form class="naviwrapper__edit edit-box"
|
|
||||||
method="POST"
|
|
||||||
enctype="multipart/form-data"
|
|
||||||
action="?action=update">
|
|
||||||
<h4>Edit box</h4>
|
|
||||||
<!-- It is important that there is no indent ↓ -->
|
|
||||||
<textarea class="edit-box__text" name="text">
|
|
||||||
{{ .Text }}</textarea>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
@ -1,21 +0,0 @@
|
|||||||
<div style=""><h4>Text MIME-type</h4>
|
|
||||||
<p>Good types are <code>text/markdown</code> and <code>text/plain</code></p>
|
|
||||||
<input type="text" name="text_mime" value="{{ .TextMime }}" form="edit-form"/>
|
|
||||||
|
|
||||||
<h4>Revision comment</h4>
|
|
||||||
<p>Please make your comment helpful</p>
|
|
||||||
<input type="text" name="comment" value="Update {{ .Name }}" form="edit-form"/>
|
|
||||||
|
|
||||||
<h4>Edit tags</h4>
|
|
||||||
<p>Tags are separated by commas, whitespace is ignored</p>
|
|
||||||
<input type="text" name="tags" value="{{ .Tags }}" form="edit-form"/>
|
|
||||||
|
|
||||||
<h4>Upload file</h4>
|
|
||||||
<p>If this hypha has a file like that, the text above is meant to be a description of it</p>
|
|
||||||
<input type="file" name="binary" form="edit-form"/>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<input type="submit" value="update" form="edit-form"/>
|
|
||||||
<a href="?">Cancel</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
@ -1,4 +1,4 @@
|
|||||||
According to real *scientists*, fruit is a type of fetus. Most of them are tasty and cool, though some of them are really sour and depressing. Be careful when choosing fruit. Best ones are:
|
According to real *scientists*, fruit is a type of fetus. Most of them are tasty and cool, though some of them are really sour and depressing. Be careful when choosing fruit. Best ones are:
|
||||||
|
|
||||||
* [Apple](Apple)
|
* [Apple](Apple)
|
||||||
* [Pear](Pear)
|
* [Pear](Pear)
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
@ -1,3 +1,3 @@
|
|||||||
Красное яблоко. Для съёмки использовалась белая бумага позади и над яблоком, и фотовспышка SB-600 в 1/4 мощности.
|
Красное яблоко. Для съёмки использовалась белая бумага позади и над яблоком, и фотовспышка SB-600 в 1/4 мощности.
|
||||||
|
|
||||||
Source: https://commons.wikimedia.org/wiki/File:Red_Apple.jpg
|
Source: https://commons.wikimedia.org/wiki/File:Red_Apple.jpg
|
@ -1,6 +1,6 @@
|
|||||||
Mycorrhiza is pure happiness
|
Mycorrhiza is pure happiness
|
||||||
|
|
||||||
Красное яблоко. Для съёмки использовалась белая бумага позади и над яблоком, и фотовспышка SB-600 в 1/4 мощности.
|
Красное яблоко. Для съёмки использовалась белая бумага позади и над яблоком, и фотовспышка SB-600 в 1/4 мощности.
|
||||||
|
|
||||||
Source: https://commons.wikimedia.org/wiki/File:Red_Apple.jpg
|
Source: https://commons.wikimedia.org/wiki/File:Red_Apple.jpg
|
||||||
|
|
Before Width: | Height: | Size: 427 KiB After Width: | Height: | Size: 427 KiB |
@ -1,2 +1,2 @@
|
|||||||
Я́блоко — сочный плод яблони, который употребляется в пищу в свежем виде, служит сырьём в кулинарии и для приготовления напитков. Наибольшее распространение получила яблоня домашняя, реже выращивают яблоню сливолистную. Размер красных, зелёных или жёлтых шаровидных плодов 5—13 см в диаметре. Происходит из Центральной Азии, где до сих пор произрастает дикорастущий предок яблони домашней — яблоня Сиверса. На сегодняшний день существует множество сортов этого вида яблони, произрастающих в различных климатических условиях. По времени созревания отличают летние, осенние и зимние сорта, более поздние сорта отличаются хорошей стойкостью.
|
Я́блоко — сочный плод яблони, который употребляется в пищу в свежем виде, служит сырьём в кулинарии и для приготовления напитков. Наибольшее распространение получила яблоня домашняя, реже выращивают яблоню сливолистную. Размер красных, зелёных или жёлтых шаровидных плодов 5—13 см в диаметре. Происходит из Центральной Азии, где до сих пор произрастает дикорастущий предок яблони домашней — яблоня Сиверса. На сегодняшний день существует множество сортов этого вида яблони, произрастающих в различных климатических условиях. По времени созревания отличают летние, осенние и зимние сорта, более поздние сорта отличаются хорошей стойкостью.
|
||||||
|
|
@ -1,3 +1,3 @@
|
|||||||
A **pear** is a sweet fruit, usually with a green skin and a lot of juice, that has a round base and is slightly pointed towards the stem.
|
A **pear** is a sweet fruit, usually with a green skin and a lot of juice, that has a round base and is slightly pointed towards the stem.
|
||||||
|
|
||||||
Source of info: [cambridge dict](https://dictionary.cambridge.org/ru/словарь/английский/pear)
|
Source of info: [cambridge dict](https://dictionary.cambridge.org/ru/словарь/английский/pear)
|
@ -1,3 +1,3 @@
|
|||||||
Amanita muscaria, commonly known as the fly agaric or fly amanita, is a basidiomycete of the genus Amanita. It is also a muscimol mushroom. Native throughout the temperate and boreal regions of the Northern Hemisphere, Amanita muscaria has been unintentionally introduced to many countries in the Southern Hemisphere, generally as a symbiont with pine and birch plantations, and is now a true cosmopolitan species. It associates with various deciduous and coniferous trees.
|
Amanita muscaria, commonly known as the fly agaric or fly amanita, is a basidiomycete of the genus Amanita. It is also a muscimol mushroom. Native throughout the temperate and boreal regions of the Northern Hemisphere, Amanita muscaria has been unintentionally introduced to many countries in the Southern Hemisphere, generally as a symbiont with pine and birch plantations, and is now a true cosmopolitan species. It associates with various deciduous and coniferous trees.
|
||||||
|
|
||||||
It is not an [](Apple)!
|
It is not an [](Apple)!
|
@ -1,4 +1,4 @@
|
|||||||
Amanita muscaria, commonly known as the fly agaric or fly amanita, is a basidiomycete of the genus Amanita. It is also a muscimol mushroom. Native throughout the temperate and boreal regions of the Northern Hemisphere, Amanita muscaria has been unintentionally introduced to many countries in the Southern Hemisphere, generally as a symbiont with pine and birch plantations, and is now a true cosmopolitan species. It associates with various deciduous and coniferous trees.
|
Amanita muscaria, commonly known as the fly agaric or fly amanita, is a basidiomycete of the genus Amanita. It is also a muscimol mushroom. Native throughout the temperate and boreal regions of the Northern Hemisphere, Amanita muscaria has been unintentionally introduced to many countries in the Southern Hemisphere, generally as a symbiont with pine and birch plantations, and is now a true cosmopolitan species. It associates with various deciduous and coniferous trees.
|
||||||
|
|
||||||
It is not an [Apple](Apple)!
|
It is not an [Apple](Apple)!
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
Amanita muscaria, commonly known as the fly agaric or fly amanita, is a basidiomycete of the genus Amanita. It is also a muscimol mushroom. Native throughout the temperate and boreal regions of the Northern Hemisphere, Amanita muscaria has been unintentionally introduced to many countries in the Southern Hemisphere, generally as a symbiont with pine and birch plantations, and is now a true cosmopolitan species. It associates with various deciduous and coniferous trees.
|
Amanita muscaria, commonly known as the fly agaric or fly amanita, is a basidiomycete of the genus Amanita. It is also a muscimol mushroom. Native throughout the temperate and boreal regions of the Northern Hemisphere, Amanita muscaria has been unintentionally introduced to many countries in the Southern Hemisphere, generally as a symbiont with pine and birch plantations, and is now a true cosmopolitan species. It associates with various deciduous and coniferous trees.
|
||||||
|
|
||||||
It is not an [Apple](/Apple)!
|
It is not an [Apple](/Apple)!
|
||||||
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
Amanita muscaria, commonly known as the fly agaric or fly amanita, is a basidiomycete of the genus Amanita. It is also a muscimol mushroom. Native throughout the temperate and boreal regions of the Northern Hemisphere, Amanita muscaria has been unintentionally introduced to many countries in the Southern Hemisphere, generally as a symbiont with pine and birch plantations, and is now a true cosmopolitan species. It associates with various deciduous and coniferous trees.
|
Amanita muscaria, commonly known as the fly agaric or fly amanita, is a basidiomycete of the genus Amanita. It is also a muscimol mushroom. Native throughout the temperate and boreal regions of the Northern Hemisphere, Amanita muscaria has been unintentionally introduced to many countries in the Southern Hemisphere, generally as a symbiont with pine and birch plantations, and is now a true cosmopolitan species. It associates with various deciduous and coniferous trees.
|
||||||
|
|
||||||
It is not an [Apple](/Fruit/Apple)!
|
It is not an [Apple](/Fruit/Apple)!
|
||||||
|
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 608 KiB After Width: | Height: | Size: 608 KiB |
@ -1,7 +1,7 @@
|
|||||||
Шляпка 7—16(20) см в диаметре, полушаровидная, раскрывающаяся до выпуклой и почти плоской со слабо вдавленным центром, с радиально разлинованным краем. Окраска тёмно-умброво-коричневая, оливково-охристая, охристо-коричневая, иногда серо-жёлтая, в центре более интенсивная. Общее покрывало на молодых грибах опушённое, ярко-жёлтое, затем остаётся в виде легко смываемых обрывков, на солнце белеющих, а к старости иногда становящихся серо-жёлтыми.
|
Шляпка 7—16(20) см в диаметре, полушаровидная, раскрывающаяся до выпуклой и почти плоской со слабо вдавленным центром, с радиально разлинованным краем. Окраска тёмно-умброво-коричневая, оливково-охристая, охристо-коричневая, иногда серо-жёлтая, в центре более интенсивная. Общее покрывало на молодых грибах опушённое, ярко-жёлтое, затем остаётся в виде легко смываемых обрывков, на солнце белеющих, а к старости иногда становящихся серо-жёлтыми.
|
||||||
|
|
||||||
|
|
||||||
Пластинки частые, сначала узко-приросшие к ножке, затем свободные от неё, кремовые, с многочисленными пластиночками разной длины.
|
Пластинки частые, сначала узко-приросшие к ножке, затем свободные от неё, кремовые, с многочисленными пластиночками разной длины.
|
||||||
|
|
||||||
|
|
||||||
Ножка достигает 9—20 см в высоту и 1—2,5 см в поперечнике, утончающаяся кверху, в основании с яйцевидным или шаровидным утолщением. Поверхность ножки волокнисто-бархатистая, белая или беловатая, при прикосновении иногда слабо буреющая. Кольцо в верхней части ножки, беловатое, перепончатое, не разлинованное. Остатки общего покрывала в виде нескольких поясков желтоватых бородавчатых хлопьев на утолщении ножки.
|
Ножка достигает 9—20 см в высоту и 1—2,5 см в поперечнике, утончающаяся кверху, в основании с яйцевидным или шаровидным утолщением. Поверхность ножки волокнисто-бархатистая, белая или беловатая, при прикосновении иногда слабо буреющая. Кольцо в верхней части ножки, беловатое, перепончатое, не разлинованное. Остатки общего покрывала в виде нескольких поясков желтоватых бородавчатых хлопьев на утолщении ножки.
|
1
w/m/help/1.markdown
Normal file
@ -0,0 +1 @@
|
|||||||
|
# Help
|
21
w/m/help/meta.json
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"views": 0,
|
||||||
|
"deleted": false,
|
||||||
|
"revisions": {
|
||||||
|
"1": {
|
||||||
|
"tags": [
|
||||||
|
""
|
||||||
|
],
|
||||||
|
"name": "Help",
|
||||||
|
"comment": "Update Help",
|
||||||
|
"author": "",
|
||||||
|
"time": 1593540573,
|
||||||
|
"text_mime": "text/markdown",
|
||||||
|
"binary_mime": "",
|
||||||
|
"text_name": "1.markdown",
|
||||||
|
"binary_name": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Invalid": false,
|
||||||
|
"Err": null
|
||||||
|
}
|
@ -1,25 +1,25 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>{{ .Title }}</title>
|
<title>{{ .Title }}</title>
|
||||||
<link rel="stylesheet" href="/Templates/default-light/main.css?action=raw">
|
<link rel="stylesheet" href="/Templates/default-light/main.css?action=raw">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header class="header">
|
<header class="header">
|
||||||
<!-- Site title is fetched from your config.json. Set your title in "site-title" field. You can add more things to the header here. -->
|
<!-- Site title is fetched from your config.json. Set your title in "site-title" field. You can add more things to the header here. -->
|
||||||
<h1 class="header__site-title">
|
<h1 class="header__site-title">
|
||||||
<a href="/">{{ .SiteTitle }}</a>
|
<a href="/">{{ .SiteTitle }}</a>
|
||||||
</h1>
|
</h1>
|
||||||
<button class="sidebar-controller" id="shroomburger">
|
<button class="sidebar-controller" id="shroomburger">
|
||||||
≡
|
≡
|
||||||
</button>
|
</button>
|
||||||
</header>
|
</header>
|
||||||
<aside class="sidebar hidden_mobile" id="sidebar">
|
<aside class="sidebar hidden_mobile" id="sidebar">
|
||||||
{{ .Sidebar }}
|
{{ .Sidebar }}
|
||||||
</aside>
|
</aside>
|
||||||
<main class="main">{{ .Main }}</main>
|
<main class="main">{{ .Main }}</main>
|
||||||
<footer>
|
<footer>
|
||||||
<p>This website runs <a href='https://github.com/bouncepaw/mycorrhiza'>MycorrhizaWiki</a></p>
|
<p>This website runs <a href='https://github.com/bouncepaw/mycorrhiza'>MycorrhizaWiki</a></p>
|
||||||
</footer>
|
</footer>
|
||||||
<script src="/Templates/default-light/main.js?action=raw"></script>
|
<script src="/Templates/default-light/main.js?action=raw"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
11
w/m/templates/default-light/edit/index.html/1.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<form class="edit-box"
|
||||||
|
method="POST"
|
||||||
|
enctype="multipart/form-data"
|
||||||
|
action="?action=update"
|
||||||
|
id="edit-form">
|
||||||
|
<h4>Edit box</h4>
|
||||||
|
<!-- It is important that there is no indent ↓ -->
|
||||||
|
<textarea class="edit-box__text" name="text">
|
||||||
|
{{ .Text }}</textarea>
|
||||||
|
</form>
|
||||||
|
|
22
w/m/templates/default-light/edit/sidebar.html/1.html
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<div>
|
||||||
|
<h4>Text MIME-type</h4>
|
||||||
|
<p>Good types are <code>text/markdown</code> and <code>text/plain</code></p>
|
||||||
|
<input type="text" name="text_mime" value="{{ .TextMime }}" form="edit-form"/>
|
||||||
|
|
||||||
|
<h4>Revision comment</h4>
|
||||||
|
<p>Please make your comment helpful</p>
|
||||||
|
<input type="text" name="comment" value="Update {{ .Name }}" form="edit-form"/>
|
||||||
|
|
||||||
|
<h4>Edit tags</h4>
|
||||||
|
<p>Tags are separated by commas, whitespace is ignored</p>
|
||||||
|
<input type="text" name="tags" value="{{ .Tags }}" form="edit-form"/>
|
||||||
|
|
||||||
|
<h4>Upload file</h4>
|
||||||
|
<p>If this hypha has a file like that, the text above is meant to be a description of it</p>
|
||||||
|
<input type="file" name="binary" form="edit-form"/>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<input type="submit" value="update" form="edit-form"/>
|
||||||
|
<a href="?">Cancel</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
@ -1,53 +1,53 @@
|
|||||||
*, *::before, *::after { box-sizing: border-box; }
|
*, *::before, *::after { box-sizing: border-box; }
|
||||||
html { height: 100%; }
|
html { height: 100%; }
|
||||||
body { font: 15px/1.5 'PT Sans', system-ui, sans-serif;
|
body { font: 15px/1.5 'PT Sans', system-ui, sans-serif;
|
||||||
min-height: 100%; padding: 0; margin:0; }
|
min-height: 100%; padding: 0; margin:0; }
|
||||||
.msg { background-color: #f4f4f4; padding: 1rem; border-radius: 1rem; }
|
.msg { background-color: #f4f4f4; padding: 1rem; border-radius: 1rem; }
|
||||||
a { color: #44e; }
|
a { color: #44e; }
|
||||||
a:visited { color: #44a; }
|
a:visited { color: #44a; }
|
||||||
header { margin: 0 2rem; }
|
header { margin: 0 2rem; }
|
||||||
header * { display: inline; }
|
header * { display: inline; }
|
||||||
header h1 { margin: 0; font-size: 1rem; }
|
header h1 { margin: 0; font-size: 1rem; }
|
||||||
header a, header a:visited { color: black; text-decoration:none; }
|
header a, header a:visited { color: black; text-decoration:none; }
|
||||||
header a:active, header a:hover { color: #005f87; }
|
header a:active, header a:hover { color: #005f87; }
|
||||||
|
|
||||||
h1, h2, h3, h4, h5, h6 { margin: 0.5em 0 0.25em; }
|
h1, h2, h3, h4, h5, h6 { margin: 0.5em 0 0.25em; }
|
||||||
.page { line-height: 1.666; max-width: 40rem; hyphens: auto; }
|
.page { line-height: 1.666; max-width: 40rem; hyphens: auto; }
|
||||||
.page img { max-width:100%; }
|
.page img { max-width:100%; }
|
||||||
.page pre { white-space: break-spaces; }
|
.page pre { white-space: break-spaces; }
|
||||||
.page__title { font-size: 2rem; margin: 0; }
|
.page__title { font-size: 2rem; margin: 0; }
|
||||||
|
|
||||||
footer { padding: 1rem 0; font-size: .8rem; bottom: 0; position: absolute; }
|
footer { padding: 1rem 0; font-size: .8rem; bottom: 0; position: absolute; }
|
||||||
footer a, footer a:visited { color: black; }
|
footer a, footer a:visited { color: black; }
|
||||||
/* Sidebar section */
|
/* Sidebar section */
|
||||||
.sidebar { padding: 1rem 0; background: #f4f4f4; }
|
.sidebar { padding: 1rem 0; background: #f4f4f4; }
|
||||||
.sidebar div { margin-left: 1rem; }
|
.sidebar div { margin-left: 1rem; }
|
||||||
.sidebar-controller { font: inherit; padding: .25rem 1rem;
|
.sidebar-controller { font: inherit; padding: .25rem 1rem;
|
||||||
font-size: 2rem; float: right; }
|
font-size: 2rem; float: right; }
|
||||||
|
|
||||||
.hypha-actions ul { margin: 0; padding: 0; }
|
.hypha-actions ul { margin: 0; padding: 0; }
|
||||||
.hypha-actions li { list-style: none; }
|
.hypha-actions li { list-style: none; }
|
||||||
.hypha-actions a { display: block; padding: .25rem 1rem; font: inherit;
|
.hypha-actions a { display: block; padding: .25rem 1rem; font: inherit;
|
||||||
text-decoration: none; color: black; }
|
text-decoration: none; color: black; }
|
||||||
.hypha-actions a:hover { background: #eaeaea; }
|
.hypha-actions a:hover { background: #eaeaea; }
|
||||||
|
|
||||||
.navitree__node { padding-left: 2rem; }
|
.navitree__node { padding-left: 2rem; }
|
||||||
.navitree__entry { margin-bottom: .5rem; }
|
.navitree__entry { margin-bottom: .5rem; }
|
||||||
.navitree__link, .navitree__link:visited { color:black; text-decoration:none; }
|
.navitree__link, .navitree__link:visited { color:black; text-decoration:none; }
|
||||||
.navitree__link:hover, .navitree__link:active { text-decoration:underline; }
|
.navitree__link:hover, .navitree__link:active { text-decoration:underline; }
|
||||||
.navitree__ancestor { list-style: none; margin-left: -1rem; }
|
.navitree__ancestor { list-style: none; margin-left: -1rem; }
|
||||||
.navitree__pagename a { font-weight: bold; }
|
.navitree__pagename a { font-weight: bold; }
|
||||||
|
|
||||||
@media (max-width: 950px) {
|
@media (max-width: 950px) {
|
||||||
.hidden_mobile { display: none; }
|
.hidden_mobile { display: none; }
|
||||||
aside { height: 100%; }
|
aside { height: 100%; }
|
||||||
main, footer, header { margin: 0 1rem; }
|
main, footer, header { margin: 0 1rem; }
|
||||||
header, header * { display:inline; }
|
header, header * { display:inline; }
|
||||||
.edit-box__text { width: 100%; height: 70%; }
|
.edit-box__text { width: 100%; height: 70%; }
|
||||||
}
|
}
|
||||||
@media (min-width: 950px) {
|
@media (min-width: 950px) {
|
||||||
.sidebar-controller { display: none; }
|
.sidebar-controller { display: none; }
|
||||||
aside { float:right; width: 300px; padding: 0; }
|
aside { float:right; width: 300px; padding: 0; }
|
||||||
main, footer { margin: 0 0 auto 2rem; }
|
main, footer { margin: 0 0 auto 2rem; }
|
||||||
.edit-box__text { min-width: 600px; height: 70%; }
|
.edit-box__text { min-width: 600px; height: 70%; }
|
||||||
}
|
}
|
@ -1,11 +1,11 @@
|
|||||||
var isOpen = false
|
var isOpen = false
|
||||||
var sidebar = document.getElementById('sidebar')
|
var sidebar = document.getElementById('sidebar')
|
||||||
var btn = document.getElementById('shroomburger')
|
var btn = document.getElementById('shroomburger')
|
||||||
btn.addEventListener('click', function() {
|
btn.addEventListener('click', function() {
|
||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
sidebar.classList.add('hidden_mobile')
|
sidebar.classList.add('hidden_mobile')
|
||||||
} else {
|
} else {
|
||||||
sidebar.classList.remove('hidden_mobile')
|
sidebar.classList.remove('hidden_mobile')
|
||||||
}
|
}
|
||||||
isOpen = !isOpen
|
isOpen = !isOpen
|
||||||
})
|
})
|
@ -1,8 +1,8 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Saved {{ .Name }}</title>
|
<title>Saved {{ .Name }}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<p>Saved successfully. <a href="/{{ .Name }}">Go back</a></p>
|
<p>Saved successfully. <a href="/{{ .Name }}">Go back</a></p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -4,7 +4,7 @@
|
|||||||
"revisions": {
|
"revisions": {
|
||||||
"1": {
|
"1": {
|
||||||
"tags": null,
|
"tags": null,
|
||||||
"name": "updateOk.html",
|
"name": "update_ok.html",
|
||||||
"comment": "Create Templates/default-light/updateOk.html",
|
"comment": "Create Templates/default-light/updateOk.html",
|
||||||
"author": "",
|
"author": "",
|
||||||
"time": 1592996644,
|
"time": 1592996644,
|
||||||
@ -14,4 +14,4 @@
|
|||||||
"binary_name": ""
|
"binary_name": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
<div class="hypha-actions">
|
<div class="hypha-actions">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="?action=edit">Edit</a></li>
|
<li><a href="?action=edit">Edit</a></li>
|
||||||
<li><a href="?action=getBinary">Download</a></li>
|
<li><a href="?action=binary">Download</a></li>
|
||||||
<li><a href="?action=zen">Zen mode</a></li>
|
<li><a href="?action=zen">Zen mode</a></li>
|
||||||
<li><a href="?action=raw">View raw</a></li>
|
<li><a href="?action=raw">View raw</a></li>
|
||||||
</ul>
|
</ul>
|