getzola / hyde

Port of https://github.com/poole/hyde to Zola
MIT License
77 stars 51 forks source link

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

Open rochacbruno opened 4 years ago

rochacbruno commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

@Keats What I am doing is:

rochacbruno commented 4 years ago

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