Initial commit

Initial commit

Add lua template
This commit is contained in:
2024-10-01 19:24:07 +08:00
commit 29502f6816
19 changed files with 2102 additions and 0 deletions

4
templates/all.html Normal file
View File

@@ -0,0 +1,4 @@
$<include src="header.html"/>
<h1>All Posts</h1>
$<post-list/>
$<include src="footer.html"/>

5
templates/footer.html Normal file
View File

@@ -0,0 +1,5 @@
<footer style="margin-top: 50px; padding-top: 20px; border-top: 1px solid #ddd; color: #666; text-align: center;">
<p>My Static Blog - Powered by Rust and CommonMark</p>
</footer>
</body>
</html>

78
templates/header.html Normal file
View File

@@ -0,0 +1,78 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Blog</title>
<style>
body {
font-family: system-ui, -apple-system, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
line-height: 1.6;
color: #333;
}
nav {
border-bottom: 2px solid #333;
padding-bottom: 10px;
margin-bottom: 30px;
}
nav a {
margin-right: 20px;
text-decoration: none;
color: #0066cc;
}
nav a:hover {
text-decoration: underline;
}
.post-list {
list-style: none;
padding: 0;
}
.post-list li {
margin-bottom: 10px;
padding: 10px;
border-left: 3px solid #0066cc;
padding-left: 15px;
}
.post-list a {
text-decoration: none;
color: #333;
font-weight: bold;
}
.post-list a:hover {
color: #0066cc;
}
.date {
color: #666;
font-size: 0.9em;
float: right;
}
article {
margin-top: 30px;
}
h1, h2, h3 {
color: #222;
}
code {
background: #f4f4f4;
padding: 2px 6px;
border-radius: 3px;
}
pre {
background: #f4f4f4;
padding: 15px;
border-radius: 5px;
overflow-x: auto;
}
pre code {
padding: 0;
}
</style>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/all">All Posts</a>
</nav>

4
templates/index.html Normal file
View File

@@ -0,0 +1,4 @@
$<include src="header.html"/>
<h1>Recent Posts</h1>
$<post-list limit=50/>
$<include src="footer.html"/>

6
templates/post.html Normal file
View File

@@ -0,0 +1,6 @@
$<include src="header.html"/>
<article>
$<post-html/>
</article>
<p><a href="/">← Back to home</a></p>
$<include src="footer.html"/>