Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Patitotective committed Aug 19, 2024
1 parent 38c430f commit 1364fc7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 30 deletions.
31 changes: 8 additions & 23 deletions grado.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ task css, "Builds the CSS":
task htmljs, "Generates single html page's JavaScript":
exec "nim js -d:relativePath --out:dist/app.js src/frontend"

task htmlpage, "Generates a single html page":
exec "nimble css"
exec "nimble htmljs"

proc copyDist() =
mkDir "dist"
cpFile "public/css/style.css", "dist/style.css"
cpDir "public/img", "dist/img"
Expand All @@ -50,32 +47,20 @@ task htmlpage, "Generates a single html page":
"frontend": "./app.js",
"style": "./style.css",
"favicon": "./img/favicon.ico",
"mathjax": "./js/mathjax/tex-chtml.js",
"mathjax": "./js/mathjax/es5/tex-chtml.js",
"matterwrap": "./js/matter-wrap/matter-wrap.min.js",
"matterjs": "./js/matter-js/matter.min.js",
# "timestamp": encodeUrl(CompileDate & CompileTime),
# "ga": config.ga
}.newStringTable()

task htmlpage, "Generates a single html page":
exec "nimble css"
exec "nimble htmljs"
copyDist()

task rhtmlpage, "Generates a single html page":
exec "nimble c -r -d:release --mm:refc src/buildcss"
exec "nim js -d:relativePath -d:release --out:dist/app.js src/frontend"

mkDir "dist"
cpFile "public/css/style.css", "dist/style.css"
cpDir "public/img", "dist/img"
cpDir "public/js", "dist/js"
rmFile "dist/js/frontend.js"

writeFile "dist/index.html", readFile("public/karax.html") %
{
"title": config.title,
"frontend": "./app.js",
"style": "./style.css",
"favicon": "./img/favicon.ico",
"mathjax": "./js/mathjax/tex-chtml.js",
"matterwrap": "./js/matter-wrap/matter-wrap.min.js",
"matterjs": "./js/matter-js/matter.min.js",
# "timestamp": encodeUrl(CompileDate & CompileTime),
# "ga": config.ga
}.newStringTable()
copyDist()
Loading

0 comments on commit 1364fc7

Please sign in to comment.