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

Allow posts with no date field for sections sorted by date. #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rochacbruno
Copy link

Having content/_index.md like this

+++
sort_by = "date"
+++

Allows to show on home page only posts having a date metadata.

Sometimes it is useful to create a page like an /about/ that is not listed on home page but accessible only via link.

Currently hyde is failing because date filter requires a date.

@Keats
Copy link
Collaborator

Keats commented Nov 18, 2019

I don't think it would work. Pages in a sorted section missing the sort attribute are ignored in Zola and I don't think they get rendered? I could be wrong, haven't done it in a long time so the memory is fuzzy

@rochacbruno
Copy link
Author

@Keats I created a page without a date, because I dont wanted it to get indexed, wanted acessible by url only.

Zola ignores that page when building the index, but the page is rendered when accessed by URL.

Is there other way to creates pages like /about that should not be listed on section index?

@Keats
Copy link
Collaborator

Keats commented Nov 18, 2019

I totally get the reason, in my memory the ignored pages were not rendered.

Is there other way to creates pages like /about that should not be listed on section index?

Not really, I usually prefer namespacing to /blog or whatever personally. I don't think there is a way to do to handle your case nicely.

@rochacbruno
Copy link
Author

rochacbruno commented Nov 18, 2019

@Keats What I am doing is:

  • My post-title.md has a date in front-matter, then it is a post and is indexed on my / page.
  • My file page_name.md doesn't has a date, it is a static page, so Zola ignores that page on index|section.html, but renders it o page.html.
  • As long as my _index.md has a sort_by = 'date'

@rochacbruno
Copy link
Author

it would help more if we can have a list_on_index = false

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