🔧 Archives page demo shows.

This commit is contained in:
凡梦星尘 2022-07-26 22:18:43 +08:00
parent af59e93d25
commit e83dbabc3f
15 changed files with 25 additions and 126 deletions

15
.gitignore vendored
View File

@ -1,6 +1,17 @@
# Ignore files in Hugo NexT theme
exampleSite/
exampleSite/*
# Exclude special files in content folder
!exampleSite/content
!exampleSite/start.sh
exampleSite/content/*
!exampleSite/content/archives
!exampleSite/content/post
# Exclude special files in static folder
!exampleSite/static
# Exclude special files
!exampleSite/config.yaml
!exampleSite/start.sh

View File

@ -86,7 +86,7 @@ menus:
weight: 2
- identifier: archives
name: 归档
pageref: /posts
pageref: /archives
pre: archive
weight: 3
- identifier: commonweal
@ -103,7 +103,7 @@ params:
# 需要显示文章的部分即content目录下的文件夹名称
# Sections for show in home & archive page
# and it's forlder name which under content
mainSections: ["posts"]
mainSections: ["post"]
# 年,月,日及时间的格式化样式
# Format style for year,month,date & time
yearFormat: "2006"

View File

@ -1,19 +0,0 @@
---
title: "关于 Hugo NexT 组织"
description: ""
date: 2022-06-09T20:12:52+08:00
lastmod: 2022-06-09T20:12:52+08:00
share: false
followme: false
nav: false
copyright: false
url: about.html
---
`Hugo NexT` 组织是由众多喜爱 `NexT` 主题及风格的世界各地友人共同组建而成,为的就是让这个主题继续在 `Hugo` 引擎中也能得到发扬光大,在此也欢迎你的加入!
# 我们的愿景
延续 `NexT` 经典的黑白调搭配,保持简单的易用性及强大的功能。

View File

@ -0,0 +1,3 @@
---
date: 2022-07-26T21:46:25+08:00
---

View File

@ -1,49 +0,0 @@
#--------------------------------------
# English Version
#--------------------------------------
[ColoneFlag]
other = ":"
[SitePostsTitle]
other = "Posts"
[SiteCatesTitle]
other = "Categories"
[SiteTagsTitle]
other = "Tags"
[TableOfContents]
other = "TOC"
[SiteInfo]
other = "Site Info"
[RSSTitle]
other = "RSS Subscribe"
[CCLinkTitle]
other = "Creative Commons"
[PostPublishDate]
other = "Publish"
[PostPublishTime]
other = "Create Time"
[PostLastModDate]
other = "Update"
[PostLastModTime]
other = "Modify Time"
[PostWords]
other = "Words"
[PostWordCount]
other = "{{- .WordCount -}}"
[PostReading]
other = "Read"
[PostReadTime]
other = "{{- .ReadingTime -}}min"
[PostVisitor]
other = "Views"
[PostCatg]
other = "Categories"
[PostTag]
other = "Tags"
[PostReadMore]
other = "Read More"
[FooterPowerby]
other = "Power by %s"

View File

@ -1,7 +1,7 @@
#--------------------------------------
# English Version
#--------------------------------------
posts:
archives:
other: Posts
tag:
other: Tag

View File

@ -1,49 +0,0 @@
#--------------------------------------
# 中文版本
#--------------------------------------
[ColoneFlag]
other = ""
[SitePostsTitle]
other = "日志"
[SiteCatesTitle]
other = "分类"
[SiteTagsTitle]
other = "标签"
[TableOfContents]
other = "文章目录"
[SiteInfo]
other = "站点概览"
[RSSTitle]
other = "RSS 订阅"
[CCLinkTitle]
other = "共享知识"
[PostPublishDate]
other = "发表于"
[PostPublishTime]
other = "创建时间"
[PostLastModDate]
other = "更新于"
[PostLastModTime]
other = "修改时间"
[PostWords]
other = "字数"
[PostWordCount]
other = "{{- .WordCount -}}"
[PostReading]
other = "阅读"
[PostReadTime]
other = "{{- .ReadingTime -}}分钟"
[PostVisitor]
other = "浏览数"
[PostCatg]
other = "分类"
[PostTag]
other = "标签"
[PostReadMore]
other = "阅读全文"
[FooterPowerby]
other = "由 %s 强力驱动"

View File

@ -2,7 +2,7 @@
# 中文版本
#--------------------------------------
posts:
archives:
other: 文章
tag:
other: 标签

View File

@ -1,5 +1,7 @@
{{- if and .Page.IsSection (eq .Section "archives") }}
{{ partial "list.html" ((.Paginator (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections)).Pages.GroupByDate "2006") }}
{{- else }}
{{ partial "list.html" (.Paginator.Pages.GroupByDate "2006") }}
{{- $paginator := (.Paginate (where .Page.Site.RegularPages "Section" "in" .Site.Params.mainSections) ).Pages.GroupByDate "2006" }}
{{ partial "list.html" $paginator }}
{{ else }}
{{- $paginator := .Paginator.Pages.GroupByDate "2006" }}
{{ partial "list.html" $paginator }}
{{- end }}