Init zine

This commit is contained in:
2025-08-05 00:34:58 +08:00
parent 477b3c9a79
commit c6fc0b093b
27 changed files with 1027 additions and 0 deletions

25
layouts/blog.shtml Normal file
View File

@@ -0,0 +1,25 @@
<extend template="base.shtml">
<head id="head">
<style>
.date {
font-size: 0.9em;
}
.title h3{
margin-top: 0;
}
</style>
</head>
<body id="body">
<h1 :text="$page.title"></h1>
<div :html="$page.content()"></div>
<div>
<h2>Post list</h2>
<div :loop="$page.subpages()">
<span class="date" :text="$loop.it.date.format('January 02, 2006')"></span>
<a class="title" href="$loop.it.link()">
<h3 :text="$loop.it.title"></h3>
</a>
</div>
</div>
</body>

19
layouts/blog.xml Normal file
View File

@@ -0,0 +1,19 @@
<rss version="2.0">
<channel>
<title :text="$site.title"></title>
<link :text="$site.host_url"></link>
<description :text="$site.title.suffix(' - Blog')"></description>
<generator>Zine -- https://zine-ssg.io</generator>
<language>en-US</language>
<lastBuildDate :text="$build.generated.formatHTTP()"></lastBuildDate>
<ctx :loop="$page.subpages()">
<item>
<title :text="$loop.it.title"></title>
<description :text="$loop.it.content()"></description>
<link :text="$site.host_url.addPath($loop.it.link())"></link>
<pubDate :text="$loop.it.date.formatHTTP()"></pubDate>
<guid :text="$site.host_url.addPath($loop.it.link())"></guid>
</item>
</ctx>
</channel>
</rss>

View File

@@ -0,0 +1,25 @@
<extend template="base.shtml">
<head id="head">
<style>
.date {
font-size: 0.9em;
}
.title h3{
margin-top: 0;
}
</style>
</head>
<body id="body">
<h1 :text="$page.title"></h1>
<div :html="$page.content()"></div>
<div>
<h2>Past years</h2>
<div :loop="$page.subpages()">
<span class="date" :text="$loop.it.date.format('Year 2006')"></span>
<a class="title" href="$loop.it.link()">
<h3 :text="$loop.it.title"></h3>
</a>
</div>
</div>
</body>

45
layouts/devlog.shtml Normal file
View File

@@ -0,0 +1,45 @@
<extend template="base.shtml">
<head id="head">
<style>
.feed {
margin-top: 2em;
}
.feed>div {
margin: 0 -20px;
padding: 5px 20px;
margin-bottom: 1em;
}
.feed>div>h2 {
margin-top: 0.4em;
}
.feed>div[id]:target {
animation: pulse-div 2s ease-in-out 1 forwards;
}
@keyframes pulse-div {
0%,
100% {
background-color: #222;
}
50% {
background-color: #111;
}
}
</style>
</head>
<body id="body">
<h1 class="title" :text="$page.title"></h1>
<div :html="$page.contentSection('about')"></div>
<div class="feed" :loop="$page.contentSections().slice(1)">
<div id="$loop.it.id">
<span :text="$loop.it.id.parseDate().format('January 02, 2006')"></span>
<h2><a href="$loop.it.id.prefix('#')" :html="$loop.it.heading()"></a></h2>
<ctx :html="$loop.it.htmlNoHeading()"></ctx>
</div>
</div>
</body>

21
layouts/devlog.xml Normal file
View File

@@ -0,0 +1,21 @@
<rss version="2.0">
<channel>
<title :text="$site.title"></title>
<link :text="$site.host_url"></link>
<description :text="$site.title.suffix(' - Devlog')"></description>
<generator>Zine -- https://zine-ssg.io</generator>
<language>en-US</language>
<lastBuildDate :text="$build.generated.formatHTTP()"></lastBuildDate>
<ctx :if="$page.subpages().first?()">
<ctx :loop="$if.contentSections().slice(1)">
<item>
<title :text="$loop.it.heading()"></title>
<description :text="$loop.it.html()"></description>
<link :text="$site.host_url.addPath($page.link().suffix('#', $loop.it.id))"></link>
<pubDate :text="$loop.it.id.parseDate().formatHTTP()"></pubDate>
<guid :text="$site.host_url.addPath($page.link().suffix('#', $loop.it.id))"></guid>
</item>
</ctx>
</ctx>
</channel>
</rss>

7
layouts/index.shtml Normal file
View File

@@ -0,0 +1,7 @@
<extend template="base.shtml">
<head id="head">
</head>
<body id="body">
<h1 :text="$page.title"></h1>
<div :html="$page.content()"></div>
</body>

7
layouts/page.shtml Normal file
View File

@@ -0,0 +1,7 @@
<extend template="base.shtml">
<head id="head">
</head>
<body id="body">
<h1 :text="$page.title"></h1>
<div :html="$page.content()"></div>
</body>

40
layouts/post.shtml Normal file
View File

@@ -0,0 +1,40 @@
<extend template="base.shtml">
<head id="head">
<style>
#prev-next {
display: flex;
flex-direction: row;
justify-content: space-between;
margin-top: 40px;
}
figure {
align-self: center;
text-align: center;
font-style: italic;
}
.post {
display:flex;
flex-direction: column;
}
</style>
</head>
<body id="body">
<h1 :text="$page.title"></h1>
<div class="post" :html="$page.content()"></div>
<div id="prev-next">
<div :if="$page.prevPage?()">
<a href="$if.link()">
<span :text="$if.title"></span>
</a>
</div>
<div :if="$page.nextPage?()">
<a href="$if.link()">
<span :text="$if.title"></span>
</a>
</div>
</div>
</body>

View File

@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head id="head">
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1">
<title :text="$site.title"></title>
<link type="text/css" rel="stylesheet" href="$site.asset('style.css').link()">
<link type="text/css" rel="stylesheet" href="$site.asset('highlight.css').link()">
<!-- mathtex -->
<link type="text/css" rel="stylesheet" href="$site.asset('Temml-Local.css').link()">
<script defer src="$site.asset('temml.min.js').link()"></script>
<script defer src="$site.asset('render-mathtex.js').link()"></script>
<!-- /mathtex -->
<super>
</head>
<body id="body">
<h1 class="site-title" :text="$site.title"></h1>
<nav>
<a href="$site.page('').link()">Home</a>
&nbsp; • &nbsp;
<a href="$site.page('about').link()">About</a>
&nbsp; • &nbsp;
<a href="$site.page('blog').link()">Blog</a>
<ctx :if="$site.page('devlog').subpages().first?()">
&nbsp; • &nbsp;
<a href="$if.link()">Devlog</a>
</ctx>
</nav>
<super>
<footer>
<hr>
<h5>SITE UNDER CONSTRUCTION</h5>
<img src="$site.asset('under-construction.gif').link()" width=90>
</footer>
</body>
</html>