Add more tests and fix a bug

This commit is contained in:
Sami Samhuri 2019-12-01 15:54:54 -08:00
parent bd41c00f3a
commit 5c47b83da6
9 changed files with 39 additions and 1 deletions

View file

@ -45,7 +45,7 @@ public final class Generator {
fileManager.fileExists(atPath: fileURL.path, isDirectory: &isDir)
guard !isDir.boolValue else {
try renderPath(fileURL.path, to: targetURL.appendingPathComponent(filename))
return
continue
}
// Make sure this path exists so we can write to it.

View 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>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View 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>

View file

@ -0,0 +1 @@
i liek milk

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

View file

@ -0,0 +1 @@
hello world

View file

@ -0,0 +1,6 @@
{
"author": "A man has no name",
"email": "jaqen@hotmail.com",
"title": "Valar Morghulis",
"url": "http://example.net"
}

View 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>