You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zola version: 0.18.0
tabi version or commit: d0dd37e
Expected Behavior
When section_path in the [extra] section of front-matter of main content _index.md is set, it should be used to generate the list of posts visible in the main (first) page of the site. If, furthermore, max_posts = 1 is set, the "All posts ->" link that is then generated below the single post (the last post) visible on the main page should also point to the same section chosen with section_path
Current Behavior
If max_posts is greater than or equal to 2, everything works fine. With max_posts = 1, "All posts ->" points to a possibly non-existing "blog" section.
A little investigation shows that the issue comes from the templates/macros/list_posts.html file,
where "blog" is hard-coded, instead of using the section_path chosen by the user.
Step to Reproduce
Place the following in content/_index.md for a site in which there is no blog subdirectory (aka section):
Hello Óscar and first of all thanks for making your great theme publicly available!
I'd be happy to contribute if I can manage to sort out a general solution, but it doesn't seem to be so simple (for my personal use I just did a quickfix replacing one hard-coded section name by another).
The difficulty is that the list_posts macro must be made aware of the target section, e.g. passed as an extra argument, but some of its callers do not seem to have that information available, notably tags/single.html -- or at least not simply by the name section (I'm new to zola so I might be missing something here).
EDIT: never mind, I figured out how to fix at least the specific problem in a somewhat general way; will send a pull request a bit later when I get the time to tidy it up
Bug Report
Environment
Zola version: 0.18.0
tabi version or commit: d0dd37e
Expected Behavior
When
section_path
in the[extra]
section of front-matter of main content_index.md
is set, it should be used to generate the list of posts visible in the main (first) page of the site. If, furthermore,max_posts = 1
is set, the "All posts ->" link that is then generated below the single post (the last post) visible on the main page should also point to the same section chosen withsection_path
Current Behavior
If
max_posts
is greater than or equal to 2, everything works fine. Withmax_posts = 1
, "All posts ->" points to a possibly non-existing "blog" section.A little investigation shows that the issue comes from
the templates/macros/list_posts.html file,
where
"blog"
is hard-coded, instead of using thesection_path
chosen by the user.Step to Reproduce
Place the following in
content/_index.md
for a site in which there is noblog
subdirectory (aka section):The text was updated successfully, but these errors were encountered: