diff --git a/main.go b/main.go index 3c79273..6ee2bb6 100644 --- a/main.go +++ b/main.go @@ -90,7 +90,7 @@ Options:`) // Default page aboutFile, _ := ioutil.ReadFile(path.Join(RuntimeArgs.SourcePath, "templates/aboutpage.md")) - p := WikiData{"about", "", []string{}, []string{}, false} + p := WikiData{"help", "", []string{}, []string{}, false} p.save(string(aboutFile)) // var q WikiData diff --git a/routes.go b/routes.go index 816979d..0e57fde 100644 --- a/routes.go +++ b/routes.go @@ -94,8 +94,8 @@ func editNote(c *gin.Context) { wshandler(c.Writer, c.Request) } else if title == "robots.txt" { c.Data(200, "text/plain", []byte(robotsTxt)) - } else if strings.ToLower(title) == "about" { //}&& strings.Contains(AllowedIPs, c.ClientIP()) != true { - c.Redirect(302, "/about/view") + } else if strings.ToLower(title) == "help" { //}&& strings.Contains(AllowedIPs, c.ClientIP()) != true { + c.Redirect(302, "/Help/view") } else { locked, _ := hasPassword(title) if locked { @@ -134,11 +134,11 @@ func everythingElse(c *gin.Context) { version := c.DefaultQuery("version", "-1") noprompt := c.DefaultQuery("noprompt", "-1") versionNum, _ := strconv.Atoi(version) - if strings.ToLower(title) == "about" { + if strings.ToLower(title) == "help" { versionNum = -1 } currentText, versions, _, totalTime, encrypted := getCurrentText(title, versionNum) - if (strings.Contains(currentText, "self-destruct\n") || strings.Contains(currentText, "\nself-destruct")) && strings.ToLower(title) != "about" { + if (strings.Contains(currentText, "self-destruct\n") || strings.Contains(currentText, "\nself-destruct")) && strings.ToLower(title) != "help" { currentText = strings.Replace(currentText, "self-destruct\n", `> *This page has been deleted, you cannot return after closing.*`+"\n", 1) currentText = strings.Replace(currentText, "\nself-destruct", "\n"+`> *This page has been deleted, you cannot return after closing.*`, 1) p := WikiData{strings.ToLower(title), "", []string{}, []string{}, false} @@ -250,8 +250,8 @@ func reorderList(text string) ([]template.HTML, []string) { } func renderList(c *gin.Context, title string) { - if strings.ToLower(title) == "about" { //}&& strings.Contains(AllowedIPs, c.ClientIP()) != true { - c.Redirect(302, "/about/view") + if strings.ToLower(title) == "help" { //}&& strings.Contains(AllowedIPs, c.ClientIP()) != true { + c.Redirect(302, "/Help/view") } var p WikiData err := p.load(strings.ToLower(title)) @@ -328,7 +328,7 @@ func deletePage(c *gin.Context) { fmt.Println(adminKey) fmt.Println(deleteName) // if adminKey == RuntimeArgs.AdminKey || true == true { - if strings.ToLower(deleteName) != "about" { + if strings.ToLower(deleteName) != "help" { p := WikiData{strings.ToLower(deleteName), "", []string{}, []string{}, false} p.save("") } diff --git a/templates/aboutpage.md b/templates/aboutpage.md index 37e04c5..06e6211 100644 --- a/templates/aboutpage.md +++ b/templates/aboutpage.md @@ -2,22 +2,35 @@ # AwwKoala ## A Websocket Wiki and Kind Of A List Application -![Version 0.9](https://img.shields.io/badge/version-0.9-brightgreen.svg) +![Version 0.92](https://img.shields.io/badge/version-0.92-brightgreen.svg) This is a self-contained wiki webserver that makes sharing easy and _fast_. You can make any page you want, and any page is editable by anyone. Pages load instantly for editing, and have special rendering for whether you want to view as a web page or view as list. **AwwKoala** is also [Open Source](https://github.com/schollz/AwwKoala). ## Features -**Simplicity**. The philosophy here is to *just type*. To jot a note, simply load the page at [`/`](/) and just start typing. No need to press edit, the browser will already be focused on the text. No need to press save - it will automatically save when you stop writing. The URL at [`/`](/) will redirect to an easy-to-remember name that you can use to reload the page at anytime, anywhere. But, you can also use any URL you want, e.g. [`/AnythingYouWant`](/AnythingYouWant). +**Simplicity**. The philosophy here is to *just type*. To jot a note, simply load the page at [`/`](http://AwwKoala.com/) and just start typing. No need to press edit, the browser will already be focused on the text. No need to press save - it will automatically save when you stop writing. The URL at [`/`](http://AwwKoala.com/) will redirect to an easy-to-remember name that you can use to reload the page at anytime, anywhere. But, you can also use any URL you want, e.g. [`/AnythingYouWant`](http://AwwKoala.com/AnythingYouWant). -**Viewing**. All pages can be rendered into HTML by adding `/view`. For example, the page [`/AnythingYouWant`](/AnythingYouWant) is rendered at [`/AnythingYouWant/view`](/AnythingYouWant/view). You can write in HTML or [Markdown](https://daringfireball.net/projects/markdown/) for page rendering. To quickly link to `/view` pages, just use `[[AnythingYouWant]]`. Math is supported with [Katex](https://github.com/Khan/KaTeX) using `$\frac{1}{2}$` for inline equations and `$$\frac{1}{2}$$` for regular equations. +**Viewing**. All pages can be rendered into HTML by adding `/view`. For example, the page [`/AnythingYouWant`](http://AwwKoala.com/AnythingYouWant) is rendered at [`/AnythingYouWant/view`](http://AwwKoala.com/AnythingYouWant/view). You can write in HTML or [Markdown](https://daringfireball.net/projects/markdown/) for page rendering. To quickly link to `/view` pages, just use `[[AnythingYouWnat]]`. Math is supported with [Katex](https://github.com/Khan/KaTeX) using `$\frac{1}{2}$` for inline equations and `$$\frac{1}{2}$$` for regular equations. -**Listifying**. If you are writing a list and you want to tick off things really easily, just add `/list`. For example, after editing [`/grocery`](/grocery), goto [`/grocery/list`](/grocery/list). In this page, whatever you click on will be struck through and moved to the end. This is helpful if you write a grocery list and then want to easily delete things from it. +![Simply type to edit.](https://raw.githubusercontent.com/schollz/awwkoala/master/static/img/Main1.gif) -**Security**. HTTPS support is provided and everything is sanitized to prevent XSS attacks. Though all URLs are publicly accessible, you are free to obfuscate your website by using an obscure/random address (read: the site is still publicly accessible, just hard to find!). The automatic URL is an alliterative animal description - of which there are over 500,000 possibilities - so the URL is easy to remember and hard to guess. +**Listifying**. If you are writing a list and you want to tick off things really easily, just add `/list`. For example, after editing [`/grocery`](http://AwwKoala.com/grocery), goto [`/grocery/list`](http://AwwKoala.com/grocery/list). In this page, whatever you click on will be struck through and moved to the end. This is helpful if you write a grocery list and then want to easily delete things from it. + +![Lists are easy to make.](https://raw.githubusercontent.com/schollz/awwkoala/master/static/img/Main3.gif) + +**Automatic versioning**. All previous versions of all notes are stored and can be accessed by adding `?version=X` onto `/view` or `/edit`. If you are on the `/view` or `/edit` pages the menu below will show the most substantial changes in the history. Note, only the _current_ version can be edited (no branching allowed, yet). + +![Versioning is easy.](https://raw.githubusercontent.com/schollz/awwkoala/master/static/img/Main2.gif) + +**Self-destructing messages**. You can write a message that will delete itself when a user loads it (in any view). Useful for transmitting sensitive information. To use, simply add a line somewhere that says only "`self-destruct`". + +![Simply type to edit.](https://raw.githubusercontent.com/schollz/awwkoala/master/static/img/Main4.gif) + +**Security**. HTTPS support is provided and everything is sanitized to prevent XSS attacks. Though all URLs are publicly accessible, you are free to obfuscate your website by using an obscure/random address (read: the site is still publicly accessible, just hard to find!). In addition to TLS support, you can PGP-encrypt your messages using a passphrase. + +![Simply type to edit.](https://raw.githubusercontent.com/schollz/awwkoala/master/static/img/Main7.gif) **Keyboard Shortcuts**. Quickly transition between Edit/View/List by using `Ctl+Shift+E` to Edit, `Ctl+Shift+Z` to View, and `Ctl+Shift+L` to Listify. -**Self-destructing messages**. You can write a message that will delete itself when a user loads it (in any view). Useful for transmitting sensitive information. To use, simply add a line somewhere that says only "`self-destruct`". # Contact Any other comments, questions or anything at all, just tweet me @zack_118 diff --git a/templates/index.tmpl b/templates/index.tmpl index b3359e0..51a6903 100644 --- a/templates/index.tmpl +++ b/templates/index.tmpl @@ -91,7 +91,7 @@