mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-04-27 14:57:40 +00:00
Add more tests and fix a bug
This commit is contained in:
parent
bd41c00f3a
commit
5c47b83da6
9 changed files with 39 additions and 1 deletions
|
|
@ -45,7 +45,7 @@ public final class Generator {
|
||||||
fileManager.fileExists(atPath: fileURL.path, isDirectory: &isDir)
|
fileManager.fileExists(atPath: fileURL.path, isDirectory: &isDir)
|
||||||
guard !isDir.boolValue else {
|
guard !isDir.boolValue else {
|
||||||
try renderPath(fileURL.path, to: targetURL.appendingPathComponent(filename))
|
try renderPath(fileURL.path, to: targetURL.appendingPathComponent(filename))
|
||||||
return
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure this path exists so we can write to it.
|
// Make sure this path exists so we can write to it.
|
||||||
|
|
|
||||||
10
Tests/test-public-subdirs/expected/about.html
Normal file
10
Tests/test-public-subdirs/expected/about.html
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Valar Morghulis</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1><a href="http://example.net">Valar Morghulis</a></h1>
|
||||||
|
<p>i liek milk</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
BIN
Tests/test-public-subdirs/expected/images/sjs.png
Normal file
BIN
Tests/test-public-subdirs/expected/images/sjs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.8 KiB |
10
Tests/test-public-subdirs/expected/index.html
Normal file
10
Tests/test-public-subdirs/expected/index.html
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Valar Morghulis</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1><a href="http://example.net">Valar Morghulis</a></h1>
|
||||||
|
<p>hello world</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
1
Tests/test-public-subdirs/in/public/about.md
Normal file
1
Tests/test-public-subdirs/in/public/about.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
i liek milk
|
||||||
BIN
Tests/test-public-subdirs/in/public/images/sjs.png
Normal file
BIN
Tests/test-public-subdirs/in/public/images/sjs.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.8 KiB |
1
Tests/test-public-subdirs/in/public/index.md
Normal file
1
Tests/test-public-subdirs/in/public/index.md
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
hello world
|
||||||
6
Tests/test-public-subdirs/in/site.json
Normal file
6
Tests/test-public-subdirs/in/site.json
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"author": "A man has no name",
|
||||||
|
"email": "jaqen@hotmail.com",
|
||||||
|
"title": "Valar Morghulis",
|
||||||
|
"url": "http://example.net"
|
||||||
|
}
|
||||||
10
Tests/test-public-subdirs/in/templates/site.html
Normal file
10
Tests/test-public-subdirs/in/templates/site.html
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>{{ site.title }}</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1><a href="{{ site.url }}">{{ site.title }}</a></h1>
|
||||||
|
{{ body }}
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in a new issue