Skip to content

Commit

Permalink
feat: add new time.Now() func
Browse files Browse the repository at this point in the history
  • Loading branch information
cheunglong committed Oct 16, 2023
1 parent fdb965a commit 48c29bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ var funcMap = template.FuncMap{
}
return false
},
"now": func(format string) string {
return time.Now().Format(format)
},
}

func FetchPosts(c *gin.Context) {
Expand Down
2 changes: 1 addition & 1 deletion templates/base/footer.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<footer class="foot">
<address class="copyright">@{{.Now "2006"}} Checklist.love <a href="https://github.com/xiongbao/checklist.love">Github</a></address>
<address class="copyright">@{{now "2006"}} Checklist.love <a href="https://github.com/xiongbao/checklist.love">Github</a></address>
<script>
var _hmt = _hmt || [];
(function() {
Expand Down
4 changes: 2 additions & 2 deletions templates/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ <h1 class="siteinfo">
<i class="logo"></i><span class="name">侦爱清单</span>
</h1>
<div class="siteintro">
<h2>骗你<span>我是小猪</span></h2>
<p><span>骗不骗,清单验;</span><span>真不真,清单认</span></p>
<h2>他说<span>我没骗你</span></h2>
<p><span>骗不骗,清单验;</span><span>请按此清单检查</span></p>
<a class="btn" target="_blank" href="https://github.com/xiongbao/checklist.love/discussions/new?category=%E6%8A%95%E7%A8%BF">我要补充</a>
</div>
</div>
Expand Down

0 comments on commit 48c29bc

Please sign in to comment.