Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add hiddenFromHomePage param #37

Merged
merged 1 commit into from
Mar 8, 2018
Merged

Conversation

lzjluzijie
Copy link
Contributor

Use hidden: true to hide a post on the index page.

@olOwOlo
Copy link
Owner

olOwOlo commented Mar 6, 2018

谢谢你的PR~

我不是很理解 hidden 的语义,是说这个 post 只是不会出现在首页但仍然会显示在 archive, terms, rss 等页面吗?如果是这样的话, hidden 或许不是一个适当的参数名。

@lzjluzijie
Copy link
Contributor Author

@olOwOlo 那叫 IndexHidden ? 要不要把 default.md 也加一行呢?

@olOwOlo
Copy link
Owner

olOwOlo commented Mar 7, 2018

那叫 IndexHidden ?

想不出好名字就用 hideFromHomePage 吧,虽然长了点~

要不要把 default.md 也加一行呢?

需要的,另外那篇示例 post 不需要那些多余的内容,用最少的参数和内容(英文)简单表述一下这是一篇不会显示在首页的 post 即可。

@lzjluzijie
Copy link
Contributor Author

改好啦 @olOwOlo

@lzjluzijie
Copy link
Contributor Author

不对我好像发现一个奇怪的bug 如果hiddenFromHomePage有大写就没用

@lzjluzijie
Copy link
Contributor Author

貌似bug是只要 index.html 里面 ".Params.hiddenfromhomepage" "!=" true 的 "hiddenfromhomepage" 必须是全小写的。Markdown文件可以是hiddenFromHomePage: true

@lzjluzijie
Copy link
Contributor Author

这是貌似是一个奇怪的BUG,我又修改成了能用的情况,你那边也测试一下吧……

@lzjluzijie lzjluzijie changed the title feat: add hidden param feat: add hiddenFromHomePage param Mar 8, 2018
@olOwOlo
Copy link
Owner

olOwOlo commented Mar 8, 2018

应该是 hugo 处理参数时不一致导致的吧(猜测..),指定多语言的时候也不能用大写 🤒


注意引号嵌套,用这些就够了:

title: "This is a hidden post."
date: 2018-03-08T17:40:19+08:00
lastmod: 2018-03-08T17:40:19+08:00
draft: false
author: '<a href="https://halu.lu" target="_blank">Halulu</a>'

hiddenFromHomePage: true

@lzjluzijie
Copy link
Contributor Author

嗯我改了一下

@olOwOlo olOwOlo merged commit 5277734 into olOwOlo:master Mar 8, 2018
@lzjluzijie
Copy link
Contributor Author

这个bug要不要跟hugo那边说一下?

@olOwOlo
Copy link
Owner

olOwOlo commented Mar 9, 2018

为什么要问我~ o( ̄▽ ̄)o,或许你可以去他们的论坛里问问先~

@lzjluzijie
Copy link
Contributor Author

https://gohugo.io/variables/page/#page-level-params
好吧我自己没仔细看文档,issue写完了才看见233

@olOwOlo
Copy link
Owner

olOwOlo commented Mar 10, 2018

原来是这样啊~(〃ノωノ)

daymade pushed a commit to daymade/hugo-theme-even that referenced this pull request Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants