First commit

This commit is contained in:
Brandon Dyck 2024-10-08 08:26:14 -06:00
commit d3beb92c8e
10 changed files with 84 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.vscode
.zig-cache
zig-out

3
assets/style.css Normal file
View File

@ -0,0 +1,3 @@
* {
font-family: Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
}

13
build.zig Normal file
View File

@ -0,0 +1,13 @@
const std = @import("std");
const zine = @import("zine");
pub fn build(b: *std.Build) !void {
zine.website(b, .{
.title = "Some Website",
.host_url = "https://example.com",
.content_dir_path = "content",
.layouts_dir_path = "layouts",
.assets_dir_path = "assets",
.debug = true,
});
}

11
build.zig.zon Normal file
View File

@ -0,0 +1,11 @@
.{
.name = "Some Website",
.version = "0.0.0",
.dependencies = .{
.zine = .{
.url = "git+https://github.com/kristoff-it/zine#1d66842aa28f4edfc437b7a5fe7863e1be3e240e",
.hash = "12202ee10bbcfad7006ba10b933b579c47acf23ad8911f4146a937cba048907156ab",
},
},
.paths = .{"."},
}

8
content/index.smd Normal file
View File

@ -0,0 +1,8 @@
---
.title = "My website",
.date = @date("2024-10-06T12:14:00-07:00"),
.author = "Brandon",
.layout = "home.shtml",
---
Check out my [posts]($link.url('http://localhost:1990/posts/index.html'))!

View File

@ -0,0 +1,7 @@
---
.title = "Nothing in Particular",
.author = "Brandon",
.date = @date("2024-10-07"),
.layout = "post.shtml",
---
Words on a page.

7
content/posts/index.smd Normal file
View File

@ -0,0 +1,7 @@
---
.title = "Posts",
.date = @date("2024-10-06T12:14:00-07:00"),
.author = "Brandon",
.layout = "posts.shtml",
---
Aint nothin here.

11
layouts/home.shtml Normal file
View File

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title :text="$site.title"></title>
</head>
<body>
<h1 :text="$page.title"></h1>
<div :html="$page.content()"></div>
</body>
</html>

12
layouts/post.shtml Normal file
View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title :text="$page.title.suffix(' — ', $site.title)"></title>
<link rel="stylesheet" type="text/css" href="$site.asset('style.css').link()">
</head>
<body>
<h1 :text="$page.title"></h1>
<ctx :html="$page.content()"></ctx>
</body>
</html>

9
layouts/posts.shtml Normal file
View File

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div :html="$page.content()"></div>
</body>
</html>