mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
28 lines
623 B
Nim
28 lines
623 B
Nim
# Test the new template file mechanism
|
|
|
|
import
|
|
os, times
|
|
|
|
include "sunset.tmpl"
|
|
|
|
const
|
|
tabs = [["home", "index"],
|
|
["news", "news"],
|
|
["documentation", "documentation"],
|
|
["download", "download"],
|
|
["FAQ", "question"],
|
|
["links", "links"]]
|
|
|
|
|
|
var i = 0
|
|
for item in items(tabs):
|
|
var content = $i
|
|
var file: TFile
|
|
if open(file, changeFileExt(item[1], "html"), fmWrite):
|
|
write(file, sunsetTemplate(current=item[1], ticker="", content=content,
|
|
tabs=tabs))
|
|
close(file)
|
|
else:
|
|
write(stdout, "cannot open file for writing")
|
|
inc(i)
|