]> Nishi Git Mirror - aya.git/commitdiff
Code cleanup
authorJames Mills <prologic@shortcircuit.net.au>
Thu, 28 Oct 2021 16:10:15 +0000 (02:10 +1000)
committerJames Mills <prologic@shortcircuit.net.au>
Thu, 28 Oct 2021 16:10:15 +0000 (02:10 +1000)
.gitignore
main.go
main_test.go

index cfd3f59737c1f09d981574f171bcd47e66bdb547..ec76799ed63578248a955108b299404da89cdfd0 100644 (file)
@@ -1,6 +1,7 @@
 *~
 *.bak
+**.pub
 
 /zs
-/.pub
 /dist
+/test.md
diff --git a/main.go b/main.go
index 49657aa8d925f1c2ffd69a88b2cff8915a44a457..f5240d6a27ba46b49a1ef585f299cdf8f2555351 100644 (file)
--- a/main.go
+++ b/main.go
@@ -33,9 +33,8 @@ func renameExt(path, oldext, newext string) string {
        }
        if oldext == "" || strings.HasSuffix(path, oldext) {
                return strings.TrimSuffix(path, oldext) + newext
-       } else {
-               return path
        }
+       return path
 }
 
 // globals returns list of global OS environment variables that start
@@ -169,7 +168,7 @@ func render(s string, vars Vars) (string, error) {
                        }
                }
        }
-       return s, nil
+       
 }
 
 // Renders markdown with the given layout into html expanding all the macros
index ada75649bbe32259d31021944a72744a79a9fab8..6470bc5331a25c2519d3d07bb2b47f62d92ca1da 100644 (file)
@@ -55,7 +55,7 @@ foo: bar
 title: Hello, world!
 ---
 Some content in markdown
-`: Vars{
+`: {
                        "foo":       "bar",
                        "title":     "Hello, world!",
                        "url":       "test.html",
@@ -67,7 +67,7 @@ Some content in markdown
 url: "example.com/foo.html"
 ---
 Hello
-`: Vars{
+`: {
                        "url":       "example.com/foo.html",
                        "__content": "Hello\n",
                },