【发布时间】:2021-12-12 12:31:24
【问题描述】:
我是pelican 的新手,我最近创建了我的个人博客网站
- 我的网站链接:hosted on github pages
- 源代码:on github
在
ghp-import的帮助下,网站托管在gh-pages分支上
在这里,我想为每个类别生成自定义类别欢迎/主页。我不想显示该特定类别的所有文章。我通过在类别的每个特定文件夹中创建 index.html 文件来尝试此操作,但没有成功。也在 SO 上搜索并找到了一些相关的答案,但我不知道在我的情况下该怎么做 以下是这些问题(提及它可能对他们有帮助):
- How do I choose a category page to be the home page for a Pelican site?
- How to customize individual category pages in Pelican
- Introduction pages for categories in Pelican
我想要什么?
- 例如,在
Shah-Aayush.github.io/content/notes/类别中,我不想显示驻留在此注释类别中的所有页面,并给more按钮以展开并查看每个类别。相反,我想显示自定义介绍页面index.md。所以当我点击website 上的notes类别时,它会打开默认生成的https://shah-aayush.github.io/category/notes.html页面,但我想生成https://shah-aayush.github.io/my-notes.html页面,即index.md。 - 另一个例子:在这个配置文件类别中,我想显示
profiles.md的内容,而不是显示all contents reside in profile folder/category10ff.md、spotify.md、profiles.md并给出more按钮来展开每个。 那么当我点击个人资料时它现在显示什么:https://shah-aayush.github.io/category/profiles.html
当我单击个人资料类别时,我希望它显示什么:https://shah-aayush.github.io/my-profiles.html
如何做到这一点?在此先感谢:)
【问题讨论】:
-
您是说对于每个类别,您想在该类别的帖子之前显示一些内容吗?如果是这样,我认为您需要制作一个类别扩展,它将合并特定于类别的附加内容,然后覆盖类别模板。