hyde icon indicating copy to clipboard operation
hyde copied to clipboard

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

Open rochacbruno opened this issue 5 years ago • 5 comments

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.

rochacbruno avatar Nov 17 '19 23:11 rochacbruno

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

Keats avatar Nov 18 '19 19:11 Keats

@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?

rochacbruno avatar Nov 18 '19 19:11 rochacbruno

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.

Keats avatar Nov 18 '19 19:11 Keats

@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 avatar Nov 18 '19 20:11 rochacbruno

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

rochacbruno avatar Nov 18 '19 20:11 rochacbruno