initialized project uses template

This commit is contained in:
U-Zyn Chua 2025-06-27 17:24:02 +08:00
parent 3790745c0d
commit 844c7fa05b
No known key found for this signature in database
GPG Key ID: 3FA0C40D17978A59
5 changed files with 34 additions and 21 deletions

View File

@ -153,6 +153,14 @@ pub fn run(
null,
);
try copySourceFile(
allocator,
install_dir,
"demo/src/app/views/layouts/default.zmpl",
"src/app/views/layouts/default.zmpl",
null,
);
try copySourceFile(
allocator,
install_dir,

View File

@ -26,6 +26,7 @@ pub fn initDataModule(build: *std.Build) !*std.Build.Module {
"demo/src/app/views/init.zig",
"demo/src/app/views/init/index.zmpl",
"demo/src/app/views/init/_content.zmpl",
"demo/src/app/views/layouts/default.zmpl",
"demo/public/jetzig.png",
"demo/public/zmpl.png",
"demo/public/favicon.ico",

View File

@ -1,6 +1,8 @@
const std = @import("std");
const jetzig = @import("jetzig");
pub const layout = "default";
/// `src/app/views/root.zig` represents the root URL `/`
/// The `index` view function is invoked when when the HTTP verb is `GET`.
/// Other view types are invoked either by passing a resource ID value (e.g. `/1234`) or by using

View File

@ -1,13 +1,3 @@
<html>
<head>
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="/styles.css" />
</head>
<body>
<div class="text-center pt-10 m-auto">
<!-- If present, renders the `message_param` response data value, add `?message=hello` to the
URL to see the output: -->
@ -18,5 +8,3 @@
@partial init/content(message: $.welcome_message)
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="/styles.css" />
<title>Jetzig App</title>
</head>
<body>
{{zmpl.content}}
</body>
</html>