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

section.pages is empty #890

Closed
patrickelectric opened this issue Dec 21, 2019 · 8 comments
Closed

section.pages is empty #890

patrickelectric opened this issue Dec 21, 2019 · 8 comments

Comments

@patrickelectric
Copy link

Bug Report

Version: 0.9.0

I have a content folder full of files
image

But when generating the website with zola build or zola server, the output of the section.pages is empty.
Template:
image

Generated:
image

Is there any way to debug it ?

@patrickelectric
Copy link
Author

It appears be something related to the orphan pages, since there is no _index.md in this subfolders.
Is it possible to use this kind of structure without moving all my files under the same folder ?

@Keats
Copy link
Collaborator

Keats commented Dec 21, 2019

Which section is that the rendering of? You don't need to put a _index.md but blog/ for example doesn't have any pages in it, just a few sections which themselves have pages.
If you want to sort by date though, you will need to add a _index.md in each year folder

@patrickelectric
Copy link
Author

The template and output is from the main index.html page.
Is is not possible to iterate over all markdowns recursively ?
I did put a _index.md but the template is still not working, I need to deal with each category individually ? There is no parameter or loop to iterate over everything ?

@patrickelectric
Copy link
Author

It appears be possible from this comment

/// Used to create a default index section if there is no _index.md in the root content directory
impl Default for Section {

@patrickelectric
Copy link
Author

I did create a content.orphan_pages to access all orphan pages, will send a PR soon.

patrickelectric added a commit to patrickelectric/zola that referenced this issue Dec 21, 2019
Fix getzola#890

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
patrickelectric added a commit to patrickelectric/zola that referenced this issue Dec 21, 2019
Fix getzola#890

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
@patrickelectric
Copy link
Author

I did the changes here to access all the pages and it's working as expected from my part.
I did create a post here https://zola.discourse.group/t/add-orphan-pages-in-content/289 before creating the PR.

@Keats
Copy link
Collaborator

Keats commented Dec 21, 2019

If you want to access pages from nested sections, you need to mark the nested ones as transparent.

@patrickelectric
Copy link
Author

Great, thanks

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

2 participants