Comments (11)
暂时无法复现出这个问题。
建议检查一下:
- 你是否正确配置了Taxonomies
- 另外请劳烦您提供一下某篇博文的 Frontmatter 区。(一篇就够
from hugo-theme-diary.
暂时无法复现出这个问题。
建议检查一下:
- 你是否正确配置了Taxonomies
- 另外请劳烦您提供一下某篇博文的 Frontmatter 区。(一篇就够
你好,我的配置文件如下:
# hugo site config
baseurl = "https://guyueshui.github.io/yukynn"
languageCode = "zh-cn"
defaultContentLanguage = "zh-cn"
title = "Yukynnの窝"
theme = "diary"
# copyright = ""
# googleAnalytics = ""
# disqusShortname = ""
# enableRobotsTXT = true
# baseURL = "https://guyueshui.github.io/yukynn"
# preserveTaxonomyNames = true
enableRobotsTXT = true
enableEmoji = true
footnoteReturnLinkContents = "↩"
hasCJKLanguage = true
[params]
subtitle="子在川上曰,逝者如斯夫。"
# background = "#f8f8f5"
author = "Yukynn"
description = "Yukynn's showcase"
siteStartYear = 2020
# paginate of archives, tags and categories # 归档、标签、分类每页显示的文章数目,建议修改为一个较大的值
# archivePaginate = 15
# The date format to use; for a list of valid formats, see https://gohugo.io/functions/format/
dateFormatToUse = "January 2, 2006"
[blackfriday]
# translate new line into linebreaks
# extensions = ["hardLineBreak"]
smartypants = false
[taxonomies]
tag = "tags"
category = "categories"
[[menu.main]]
url = "/posts"
name = "文章"
weight = 1
[[menu.main]]
url = "/categories"
name = "分类"
weight = 2
[[menu.main]]
url = "/tags"
name = "标签"
weight = 3
[[menu.main]]
url = "/about"
name = "关于"
weight = 4
[[menu.main]]
url = "/index.xml"
name = "订阅"
weight = 5
昨天刚开始建站,从我的博客里拷了几篇文章来,frontmatter如下:
---
title: Hello World
date: 2020-03-11T20:50:39+08:00
lastmod: 2020-03-11T20:50:39+08:00
categories: "cat1"
tags: ["tag1", "tag2"]
featured_image: "/artworks/bilibilier.jpg"
description: 你好世界,愿这里成为你的一片净土。
---
上面这个是hello-world, 我也从我之前博客里复制了几篇过来,frontmatter可能不一样,但仅仅只是date format的区别。
from hugo-theme-diary.
from hugo-theme-diary.
我的复现步骤:
- 将博客目录重新复制了一份,清除contents下的内容
- posts下新建一个空白的.md文件,将你的Frontmatter复制过来。(为方便起见 我去掉了和此问题无关紧要的featured_image选项)并且随手粘贴了一点其他内容
- 替换掉config.toml
你可以再检查一下,重新启动hugo server
,看看结果是否正常。
因为hugo server
默认处于快速渲染模式下,更改博文的分类,hugo server
默认并不会实时更新。
from hugo-theme-diary.
佛了,我复现了一下,
hugo new site test
cd test
cd themes
git clone https://github.com/AmazingRise/hugo-theme-diary.git diary
cd ..
mv themes/diary/exampleSite/config.toml ./config.toml
cp /path/to/hello-world.md ./content/posts/
cat ./content/hello-world.md
---
title: Hello World
date: 2020-03-11T20:50:39+08:00
lastmod: 2020-03-11T20:50:39+08:00
categories: "cat1"
tags: ["tag1", "tag2"]
description: 你好世界,愿这里成为你的一片净土。
---
balabala....
然后还是有这个问题:
难道是看机器的吗orz..., 麻烦你了,你还是找不到原因的话就算了吧,感谢!
from hugo-theme-diary.
- 你的 Hugo 版本是多少?(
hugo version
) - 打开 F12,看看控制台里面是否有报错?
- 另外如果你换一个主题,这个现象是否能够复现?
from hugo-theme-diary.
$ hugo version
Hugo Static Site Generator v0.65.0/extended linux/amd64 BuildDate: unknown
以下是even主题的截图:
category和tag页面正常。
from hugo-theme-diary.
佛了,我复现了一下,
hugo new site test cd test cd themes git clone https://github.com/AmazingRise/hugo-theme-diary.git diary cd .. mv themes/diary/exampleSite/config.toml ./config.toml cp /path/to/hello-world.md ./content/posts/ cat ./content/hello-world.md --- title: Hello World date: 2020-03-11T20:50:39+08:00 lastmod: 2020-03-11T20:50:39+08:00 categories: "cat1" tags: ["tag1", "tag2"] description: 你好世界,愿这里成为你的一片净土。 --- balabala....
按照本楼层的配置,尝试用 hugo
命令生成网站,看 /public/categories
目录下是否有文件夹?
或者说用hugo server
,看是否能访问 http://localhost:1313/categories/cat1/
如果上面的回答都是 Yes,那么你尝试一下修改这行代码
从{{ range .Paginator.Pages }}
改为 {{ range .Pages }}
看看问题是否存在
from hugo-theme-diary.
Yes, and 有了!非常感谢!什么原因呢?
from hugo-theme-diary.
我以前在用 0.65 的时候没有这个问题。
这个地方是对所有的分类进行遍历,如果套了个 Paginator 就是要求分页。
所以去掉 Paginator 的后果就是,如果你有 1w 个分类,都会显示在一页上,不会分页。
我查了一下官方论坛上的说法:链接
这种用法是允许的,但是搞不明白为什么在你的环境下运行不通,貌似之前也没有别人反馈过这个问题。
我觉得这个问题:Pagination with terms doesn't work in my environment
可以反馈到 Hugo 那边。
from hugo-theme-diary.
I have pinned this issue.
If someone else can reproduce the bug, please re-open this issue.
from hugo-theme-diary.
Related Issues (20)
- 是否可以考虑使用此字体 HOT 1
- 夜间模式下看不见表格内容 HOT 2
- images not displaying HOT 2
- Dark mode refactor HOT 4
- Single quote is replaced with ’ HOT 6
- How to add RSS feed? I don't understand where to add rss link. HOT 3
- Google Analytics 4 will be replaced by Universal Analytics HOT 3
- Way to remove the darkmode toggle? HOT 1
- The About page appears on the homepage article list HOT 2
- <br> new line is not supported in this theme? HOT 1
- Summary feature required
- Can you add Artalk comment function?
- Language meta label and <h1> needed for better SEO HOT 2
- Drawers are not hidden when clicking ToC items on mobile view. HOT 1
- Fix highlighting
- 作者能麻烦您考虑一下加上视频播放功能吗 HOT 1
- URL for Tags does not seem to use baseURL
- error calling Paginator: pagination not supported for this page HOT 5
- iOS safari scrolls pages upwards / incorrect css syntax when headlines are used? HOT 2
- can't deploy site with vercel.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugo-theme-diary.