Skip to content

Commit 21ff41b

Browse files
committed
Moved testsite to new examples folder.
Added test for file processing order.
1 parent e866f9a commit 21ff41b

32 files changed

+24
-4
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ REM sure we're in the directory containing this script.
55
CD /D "%~dp0"
66

77
REM Build the website with LuaWebGen.
8-
..\webgen.exe build
8+
..\..\webgen.exe build
99

1010
REM This would also work instead of the previous line:
11-
REM lua ../webgen.lua build
11+
REM lua ../../webgen.lua build
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,21 @@ end
6262

6363
-- After all generation.
6464
config.validate = function()
65+
local fileInfos = getOutputtedFiles()
66+
6567
print("Written files:")
6668
printf(" %-30s %-40s %s", "SOURCE", "PATH", "URL")
67-
for _, fileInfo in ipairs(getOutputtedFiles()) do
69+
for _, fileInfo in ipairs(fileInfos) do
6870
printf(" %-30s %-40s %s", fileInfo.sourcePath, fileInfo.path, fileInfo.url)
6971
end
72+
73+
local fileInfoNonTemplate = find(fileInfos, "sourcePath", "/images/head.png")
74+
local fileInfoNonPage = find(fileInfos, "sourcePath", "/css/style.css")
75+
local fileInfoPage = find(fileInfos, "sourcePath", "/blog/index.md")
76+
local fileInfoSitemap = find(fileInfos, "sourcePath", "/sitemap.xml")
77+
assert(fileInfoNonTemplate.serial < fileInfoNonPage.serial)
78+
assert(fileInfoNonPage.serial < fileInfoPage.serial)
79+
assert(fileInfoPage.serial < fileInfoSitemap.serial)
7080
end
7181

7282

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
{{
2+
page.title = "Get alerted, yo!"
3+
page.date = "2021-05-23"
4+
}}
5+
16
<script>
27
function showAlert() {
38
alert("Hello, I'm an alert!");

testsite/content/all-lists-all/a.md renamed to examples/testsite/content/all-lists-all/a.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{
22
page.title = "A"
3+
page.date = "2021-01-01"
34
lock()
45
}}
56

testsite/content/all-lists-all/b.md renamed to examples/testsite/content/all-lists-all/b.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{
22
page.title = "B"
3+
page.date = "2021-01-01"
34
lock()
45
}}
56

testsite/content/all-lists-all/c.md renamed to examples/testsite/content/all-lists-all/c.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{
22
page.title = "C"
3+
page.date = "2021-01-01"
34
lock()
45
}}
56

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)