olOwOlo / hugo-theme-even

🚀 A super concise theme for Hugo https://hugo-theme-even.netlify.app
https://hugo-theme-even.netlify.app
MIT License
2.04k stars 736 forks source link

按说明配置后首页无法列出文章列表,手动输入地址可以显示内容 #14

Closed ghost closed 3 years ago

ghost commented 6 years ago

操作系统 Debian 9

按照说明配置后,http://localhost:1313/首页不显示文章内容,但手动输入地址可以显示内容。

content/post/my-first-post.md为例(目录中只有这么一个文件),手动输入http://localhost:1313/post/my-first-post/,可以显示内容。

点击Archives,浏览器地址为http://localhost:1313/post/,也没有文章列表显示。

quickstart/config.toml是按照说明从even主题目录中复制过去的,几乎没有更改其中的参数值。

我需要如何操作才能在主页正常显示文章列表(如demo展示的那样)。

olOwOlo commented 6 years ago

我试了一次没发现问题惹~ _(:з)∠)_

  1. hugo new site quickstart
  2. cd quickstart
  3. git clone https://github.com/olOwOlo/hugo-theme-even themes/even
  4. exampleSite/config.toml 覆盖 quickstart/config.toml
  5. hugo new post/my-first-post.md my-first-post.md 的内容:

    ---
    title: "My First Post"
    date: 2017-10-12T23:52:51+08:00
    draft: true
    ---
    
    some content.
  6. hugo server -D

我的 hugo 版本是 0.29。 quickstart/layout 目录下没有别的主题的遗留文件吧? 或者你可以提供一下源文件~

kingname commented 6 years ago

我也遇到了相同的问题。我是把Hexo博客的md文件全部直接放到Hugo的content/post文件夹下,结果生成的网站,首页为空。

image

olOwOlo commented 6 years ago

@kingname 表示重现不出来(:з)∠),能否提供一个 md 文件让我试试~~

Mintpix commented 6 years ago

I've found the reason why.....

hugo quickstart里面教的是/content/posts 但@olOwOlo 的模板用的是/content/post

大概,感觉还是用quickstart里教的比较好吧

olOwOlo commented 6 years ago

@Mintpix 我参考的几个主题也都是用的 post 而不是 posts 呢,现在更改的话也会给更新主题的同学带来麻烦。而且上面的两位小伙伴都是用的 content/post 呢,所以应该不是这个原因。

Mintpix commented 6 years ago

@olOwOlo 诶..是我搞错了。但是我一开始也不能render post,后来才发现目录搞错了.

感谢一下作者这么漂亮的主题

narrowizard commented 6 years ago

@olOwOlo 我也遇到了这个问题, 最后发现是目录搞错了.
建议在readme中加一下说明.

leonf-tech commented 6 years ago

同上目录问题,主页没有内容显示,archives显示404. quickstart 中是 hugo new posts/my-first-post.md 应该是hugo new post/my-first-post.md

yyydao commented 6 years ago

类似的问题,猜测似乎首页对于渲染路径,只能是post。把config.toml拿来后,我的首页也是空白,然后进入archive显示404。查了一下,发现我之前的路径是posts的,之后将下面的配置改成posts

···
[[menu.main]]
  name = "Archives"
  weight = 20
  identifier = "archives"
  url = "/posts/"  #原来是post
···

这时候,archives能进入,也就是 http://localhost:1313/posts/,但是首页依然是空白。

然后我把自己的posts目录改成post,在把之前config.toml改回原来的post。然后都完美跑起来了。

HouLPcode commented 5 years ago

注意两点 1. content/post 2. hugo server -D 参数

monkback commented 4 years ago

类似的问题,猜测似乎首页对于渲染路径,只能是post。把config.toml拿来后,我的首页也是空白,然后进入archive显示404。查了一下,发现我之前的路径是posts的,之后将下面的配置改成posts

···
[[menu.main]]
  name = "Archives"
  weight = 20
  identifier = "archives"
  url = "/posts/"  #原来是post
···

这时候,archives能进入,也就是 http://localhost:1313/posts/,但是首页依然是空白。

然后我把自己的posts目录改成post,在把之前config.toml改回原来的post。然后都完美跑起来了。

确实是,我发现了其他有的主题也是这种情况

conn4575 commented 4 years ago

我也遇到了。。按照官方文档,文章应该放在 content 目录下都可以吧,这个能不能提供一个配置呢?

monkback commented 4 years ago

我也遇到了。。按照官方文档,文章应该放在 content 目录下都可以吧,这个能不能提供一个配置呢?

post可以,posts就不行

xmasuhai commented 4 years ago

配置参数,HTML中可以引用

[params] since = "2019" # Site creation time # 站点建立时间,必须早于发布文章的事件否则文章不显示

solider245 commented 4 years ago

把config.toml拿来后,我的首页也是空白,然后进入archive显示404。查了一下,发现我之前的路径是posts的,之后将下面的配置改成帖子

···
[[menu.main]]
  name = "Archives"
  weight = 20
  identifier = "archives"
  url = "/posts/"  #原来是post
···

这时候,archives能进入,也就是http://localhost:1313/posts/,但是首页依然是空白。 然后我把自己的posts目录改成post,在把之前config.toml改回原来的post。然后都完美跑起来了。

确实是,我发现了其他有的主题也是这种情况

尴尬了,我目录没问题,首页也还是没内容。但是归档那边还是有内容的。 image

还是说不能使用中文标题呢?没道理呀。

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

e7 commented 2 years ago

post、posts,网上教程真是坑多

telzhou618 commented 1 year ago

我用了 paper 主题,也是类似的问题,把 posts文件加改成 post ,首页文章列表才显示了。