Adds ability to specify scripts in config to be added to HTML.
This commit is contained in:
parent
d9b646cca1
commit
b895bf3d75
3 changed files with 5 additions and 1 deletions
|
|
@ -17,5 +17,6 @@
|
|||
<div id="ROOT" />
|
||||
|
||||
<script type="text/javascript" src="/js/forum.js?t=$timestamp"></script>
|
||||
$scripts
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -266,7 +266,8 @@ proc initialise() =
|
|||
karaxHtml = readFile("public/karax.html") %
|
||||
{
|
||||
"title": config.title,
|
||||
"timestamp": encodeUrl(CompileDate & CompileTime)
|
||||
"timestamp": encodeUrl(CompileDate & CompileTime),
|
||||
"scripts": config.scripts
|
||||
}.newStringTable()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ type
|
|||
dbPath*: string
|
||||
hostname*: string
|
||||
name*, title*: string
|
||||
scripts*: string
|
||||
|
||||
ForumError* = object of Exception
|
||||
data*: PostError
|
||||
|
|
@ -64,6 +65,7 @@ proc loadConfig*(filename = getCurrentDir() / "forum.json"): Config =
|
|||
result.hostname = root["hostname"].getStr()
|
||||
result.name = root["name"].getStr()
|
||||
result.title = root["title"].getStr()
|
||||
result.scripts = root{"scripts"}.getStr()
|
||||
|
||||
proc processGT(n: XmlNode, tag: string): (int, XmlNode, string) =
|
||||
result = (0, newElement(tag), tag)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue