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 that is nested under a page takes file path instead of URL path #2368

Open
asimpletune opened this issue Dec 10, 2023 · 4 comments
Open

Comments

@asimpletune
Copy link
Contributor

asimpletune commented Dec 10, 2023

Bug Report

Note: more info from zola discourse page

Consider the following directory structure for the rest of the bug report.

EDIT: this is fixed in #2369

# The following files
/content/posts/2013-06-02_my-vacation/index.md
/content/posts/2013-06-02_my-vacation/comments/_index.md

Environment

Zola version: 0.17.2

Expected Behavior

Tell us what should have happened.

The URL path for comments should be:

/posts/my-vacation/comments

Current Behavior

Tell us what happens instead of the expected behavior. If you are seeing an error, please include the full error message and stack trace. You can get the stacktrace of a panic by adding RUST_BACKTRACE=1 when running a zola command.

It's currently this:

/posts/2013-06-02_my-vacation/comments

Step to reproduce

Please provide the steps to reproduce the issue.
If the issue is hard to reproduce, please provide a sample repository or sample that triggers the bug.

  1. Create a page with a dated assets directory (i.e. /contents/posts/2013-06-02_my-vacation/index.md)
  2. Create a section as a subdirectory of the page from step 1
  3. Navigate to the "comments" section in the browser and you will observe the expected vs actual
@Keats
Copy link
Collaborator

Keats commented Dec 12, 2023

I just realised:

# The following files
/content/posts/2013-06-02_my-vacation/index.md
/content/posts/2013-06-02_my-vacation/comments/_index.md

is not meant to work, you cannot nest sections under a page.

@asimpletune
Copy link
Contributor Author

I see, I think that mostly makes sense, but consider the following edge case.

You have a post about your vacation, which has a commenting section. Let’s assume the comments are pages too.

Without allowing sections nested under pages there’s no good way to paginate the comment section.

Also, keep in mind that the above directory structure still works, as in it compiles, but it works in a way that defies how people expect it to behave. Once the date from a directory name is removed, it seems safe to assume that further nested parts of the path will descend as so.

So, in conclusion, I get what you’re saying and I’ve never in the past needed sections nested within pages, but now that I’ve built a commenting system I do. (See: https://spenc.es/writing/email-as-a-commenting-system/#comments)

PS: Also individual comments as pages would allow taxonomies based on the author of the comment, in addition to pagination.

@asimpletune
Copy link
Contributor Author

I also forgot to mention that I submitted a PR for this already, but that was when we thought it was a bug. #2369

If you allow it then, I assume as a feature there might be more requirements and tests added. I’m happy to do the work but I’m missing all the context @Keats has.

@Keats
Copy link
Collaborator

Keats commented Dec 17, 2023

If we allow something like that, it should be a more general change, something like https://zola.discourse.group/t/proposal-deprecate-sections/1968

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