getzola / even

A clean blog theme for Zola
MIT License
72 stars 47 forks source link

Variable `paginator.pages` breaks build #29

Closed barijaona closed 5 years ago

barijaona commented 5 years ago

The template refers to a paginator.pages variable which apparently isn't defined in a default Zola installation (Zola 0.7.0 on macOS Mojave) :

Error: Failed to render section '[[redacted]]/content/_index.md'
Reason: Failed to render 'even/templates/index.html'
Reason: Variable `paginator.pages` not found in context while rendering 'even/templates/index.html'

With RUST_BACKTRACE=1 environment variable:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: Msg("Failed to render section \'[[redacted]]/content/_index.md\'"), source: Some(Error { kind: Tera(Error { kind: Msg("Failed to render \'even/templates/index.html\'"), source: Some(Error { kind: Msg("Variable `paginator.pages` not found in context while rendering \'even/templates/index.html\'"), source: None }) }), source: None }) }', src/libcore/result.rs:997:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::continue_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::result::unwrap_failed
   9: zola::cmd::serve::serve
  10: zola::main
  11: std::rt::lang_start::{{closure}}
  12: std::panicking::try::do_call
  13: __rust_maybe_catch_panic
  14: std::rt::lang_start_internal
  15: main
Keats commented 5 years ago

Did you enable the pagination as mentioned in the README?

barijaona commented 5 years ago

Thanks for the reminder !

marimeireles commented 2 years ago

Hi, I'm having the same issue with a post that's nested: content/my_dir/index.md.

The contents of my _index.md on the content dir are:

+++
sort_by = "date"
sort_direction = "decending"

paginate_by = 5

insert_anchor_links = "none"
+++

I didn't find instructions on how to go about this. Should I open a new issue?

Thank you!

Keats commented 2 years ago

content/my_dir/index.md

This theme expects the pages to be at the root of the content directory