Skip to content

Commit db7e9dd

Browse files
authored
feat: add optional date display (zigcc#62)
1 parent abc9201 commit db7e9dd

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

content/monthly/index.smd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
.author = "ZigCC",
55
.layout = "monthly.shtml",
66
.draft = false,
7+
.custom = {
8+
.showTocDate = false
9+
}
710
---
811

912
社区内的最新进展,信息来源:[Zig NEWS](https://zig.news/top/month)、[Zig

layouts/templates/content.shtml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@
1010
<p :text="$page.author" id="author"></p>
1111
</div>
1212
<ul :loop="$page.subpages()">
13-
<a href="$loop.it.link()"><li :text="$loop.it.title"></li></a>
13+
<a href="$loop.it.link()">
14+
<li>
15+
<span :if="$page.custom.getOr('showTocDate', true)">
16+
<span :text="$loop.it.date.format('06-01-03')"></span>
17+
&nbsp;
18+
</span>
19+
<span :text="$loop.it.title"></span>
20+
</li>
21+
</a>
1422
</ul>
1523
<div class="docs" :if="$page.custom.getOr('toc', true).and($page.isSection().not())">
1624
<h1>Table of Contents</h1>

0 commit comments

Comments
 (0)