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

No default template for sections #2

Open
zmitchell opened this issue Jan 29, 2018 · 6 comments
Open

No default template for sections #2

zmitchell opened this issue Jan 29, 2018 · 6 comments

Comments

@zmitchell
Copy link

If I don't specify a template for a section, the site fails to build with the error message:

Reason: Template 'even/templates/section.html' not found

My directory structure is

content/
    posts/
        _index.md
        some_post.md
    about/
        _index.md

but the build fails for any template I use in _index.md because it's missing something i.e. paginator.page, category.name, etc.

@Keats
Copy link
Collaborator

Keats commented Jan 29, 2018

Of course I forgot to do the About page >_>

If you check the repo now I've added it in 0b44ffb

@zmitchell
Copy link
Author

Alright, I'm confused. I've pulled the most recent version of the theme and I'm using the exact directory structure as the sample content in the theme:

content/
    pages/
        _index.md
        about.md
    some_post.md
    _index.md

but I'm still getting an error Variable "paginator.pages" not found in context while rendering "even/templates/index.html" when trying to render the _index.md at the root of the contents folder.

@zmitchell
Copy link
Author

Ok, I figured it out. It looks like your paginator doesn't get created if paginate_by = 0, so when you go to iterate over paginator.pages, it freaks out. I got it to work by duplicating that section and wrapping one in if paginator is defined and one in if paginator is undefined. I've never really used templating before, so I'm not sure if there's a more elegant way to do that. Either way, I don't think it's safe to assume that the user wants pagination.

@Keats
Copy link
Collaborator

Keats commented Jan 30, 2018

This theme is expecting the main section to be paginated, I should add it to the README.

Edit: it's actually mentioned a bit already. Note that this theme is a port of an existing one, not my own creation

@devurandom
Copy link
Contributor

I also just ran into the paginator.pages issue.

@Itanq
Copy link

Itanq commented Apr 13, 2019

Alright, I'm confused. I've pulled the most recent version of the theme and I'm using the exact directory structure as the sample content in the theme:

content/
    pages/
        _index.md
        about.md
    some_post.md
    _index.md

but I'm still getting an error Variable "paginator.pages" not found in context while rendering "even/templates/index.html" when trying to render the _index.md at the root of the contents folder.

Hi @zmitchell I have already set the paginate_by = 5, But I still get the error "Reason: Variable paginator.pages not found in context while rendering 'even/templates/index.html'", you solved the issue?

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

No branches or pull requests

4 participants