Code cleanup

git-svn-id: file:///srv/svn/repo/aya/trunk@53 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
prologic
2021-10-28 16:10:15 +00:00
parent 3ad13ec62d
commit 4565d134a5
3 changed files with 6 additions and 6 deletions

3
.gitignore vendored
View File

@@ -1,6 +1,7 @@
*~
*.bak
**.pub
/zs
/.pub
/dist
/test.md

View File

@@ -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

View 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",
},