refactor: make site-root an actual file

main
Xubai Wang 2022-02-21 23:29:23 +08:00
parent bc0dd3b48a
commit 9e867f5151
3 changed files with 3 additions and 1 deletions

View File

@ -89,7 +89,7 @@ def htmlOutput (result : AnalyzerResult) (root : String) : IO Unit := do
FS.writeFile (basePath / "nav.js") navJs
FS.writeFile (basePath / "search.js") searchJs
FS.writeFile (basePath / "mathjax-config.js") mathjaxConfigJs
FS.writeFile (basePath / "site-root.js") s!"export const SITE_ROOT = \"{config.root}\";";
FS.writeFile (basePath / "site-root.js") (siteRootJs.replace "{siteRoot}" config.root)
FS.writeFile (basePath / "find" / "index.html") findHtml.toString
FS.writeFile (basePath / "find" / "find.js") findJs

View File

@ -47,6 +47,7 @@ def moduleNameToDirectory (basePath : FilePath) (n : Name) : FilePath :=
section Static
def styleCss : String := include_str "./static/style.css"
def siteRootJs : String := include_str "./static/site-root.js"
def navJs : String := include_str "./static/nav.js"
def searchJs : String := include_str "./static/search.js"
def findJs : String := include_str "./static/find/find.js"

1
static/site-root.js Normal file
View File

@ -0,0 +1 @@
export const SITE_ROOT = "{siteRoot}";