Use % instead of multiReplace for string vars.

This commit is contained in:
Dominik Picheta 2018-05-21 18:38:50 +01:00
commit 0f58f5f7a0

View file

@ -250,12 +250,12 @@ proc initialise() =
sass.compileFile(cssLoc / "nimforum.scss", cssLoc / "nimforum.css") sass.compileFile(cssLoc / "nimforum.scss", cssLoc / "nimforum.css")
# Read karax.html and set its properties. # Read karax.html and set its properties.
karaxHtml = readFile("public/karax.html").multiReplace( karaxHtml = readFile("public/karax.html") %
{ {
"$title": config.title, "title": config.title,
"$timestamp": encodeUrl(CompileDate & CompileTime) "timestamp": encodeUrl(CompileDate & CompileTime)
} }.newStringTable()
)
template createTFD() = template createTFD() =
var c {.inject.}: TForumData var c {.inject.}: TForumData
@ -1314,12 +1314,11 @@ routes:
resp Http404, readFile("public/karax.html") resp Http404, readFile("public/karax.html")
get "/about/license.html": get "/about/license.html":
let content = readFile("public/license.rst").multiReplace( let content = readFile("public/license.rst") %
{ {
"$hostname": config.hostname, "hostname": config.hostname,
"$name": config.name "name": config.name
} }.newStringTable()
)
resp content.rstToHtml() resp content.rstToHtml()
get "/threadActivity.xml": get "/threadActivity.xml":