增加index页面上每个文章的发布时间、阅读量、作者的显示。

This commit is contained in:
2026-07-30 14:55:45 +08:00
parent a9a890a849
commit 503510de2c
10 changed files with 488 additions and 3 deletions
BIN
View File
Binary file not shown.
File diff suppressed because one or more lines are too long
+5
View File
@@ -648,3 +648,8 @@ a:hover {
width: 100%;
}
}
@font-face {
font-family: layui-icon;
src: url(../font/iconfont.eot?v=240#iefix) format('embedded-opentype'), url(../font/iconfont.svg?v=240#iconfont) format('svg'), url(../font/iconfont.woff?v=240) format('woff'), url(../font/iconfont.ttf?v=240) format('truetype');
}
Binary file not shown.
File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 274 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

+2
View File
@@ -7,6 +7,8 @@
<meta name="description" content="{{.Description}}">
<link rel="icon" href="/static/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="/static/css/style.css">
<link rel="stylesheet" href="/static/css/layui.css">
</head>
<body>
<header class="header">
+6 -3
View File
@@ -16,9 +16,9 @@
{{if .IsTop}}<span class="top-badge">置顶</span>{{end}}
</h2>
<div class="post-meta">
<span class="post-date">{{if .PublishedAt}}{{.PublishedAt.Format "2006-01-02"}}{{else}}未发布{{end}}</span>
<span class="post-date">{{if .PublishedAt}}<i class="layui-icon">&#xe60e;</i>{{.PublishedAt.Format "2006-01-02"}}{{else}}未发布{{end}}</span>
<span class="post-category">
{{if .Category}}<a href="/?category={{.CategoryID}}">{{.Category.Name}}</a>{{else}}未分类{{end}}
{{if .Category}}<i class="layui-icon">&#xe705;</i><a href="/?category={{.CategoryID}}">{{.Category.Name}}</a>{{else}}未分类{{end}}
</span>
{{if .Tags}}
<span class="post-tags">
@@ -27,7 +27,10 @@
{{end}}
</span>
{{end}}
<span class="post-views">{{.Views}} 阅读</span>
<span><i class="layui-icon">&#xe66f;</i><a href="/?author={{.AuthorID}}">{{.Author.Username}}</a></span>
<span><i class="layui-icon layui-icon-user"></i>{{.PublishedAt.Format "2006-01-02"}}</span>
<span class="post-views"><i class="layui-icon">&#xe63a;</i>{{.Views}} 阅读</span>
</div>
<p class="post-summary">{{.Summary}}</p>
<a href="/post/{{.Slug}}" class="read-more">阅读全文 →</a>