diff --git a/.gitignore b/.gitignore index cfd3f59..ec76799 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *~ *.bak +**.pub /zs -/.pub /dist +/test.md diff --git a/main.go b/main.go index 49657aa..f5240d6 100644 --- 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 diff --git a/main_test.go b/main_test.go index ada7564..6470bc5 100644 --- a/main_test.go +++ b/main_test.go @@ -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", },