Replies: 3 comments
-
Hello again, I just implemeted I added two templates:
Implementing If you think it can be interesting for tabi's user, please let me know and I'll be happy to contribute but it might be limited to my personal use case. |
Beta Was this translation helpful? Give feedback.
-
Hey @ZzMzaw! Sorry I didn't reply earlier—it's been busy. I need some time to think about this and hope to get back to you before next weekend. |
Beta Was this translation helpful? Give feedback.
-
Hello @welpo , Sure, no worries and no urgency. In the future, for some small contributions like that (I have at least one other in mind), would you prefer me to go on with a discussion or to directly open a PR so you can have an idea on how it can be implemented at the same time? In that precise case, my first message was really a rough idea but I continued to refine it and ended up with an implementation so I could have just waited to open a PR. Anyway, please take the time you need and see you later :-) |
Beta Was this translation helpful? Give feedback.
-
Hello,
While I was playing with the series feature, I found something which should work (from my perspective at least) but doesn't.
In each of my series' articles, I would like to add some link between the article.
I would like to add an intro like
We've seen ... in the previous article of this series and now, we'll see ...
for all articles except the first one (because there is no previous article).I would like to add an outro like
We')ve just seen ..., and we'll see ... in the next article of this series.
for all articles except the last one (because there is no next article.Previous and next article point to the relevant previous or next article with a link (which is easy to configure thanks to the template variables).
So far, we have following templates:
next_only
- Used for the first article (has next article but no previous)middle
- Used for articles with both previous and next articlesprev_only
- Used for the last article (has previous article but no next)default
- Fallback template used when a specific position template isn’t definedIn order to achieve what I want, I would need to configure
middle
andprev_only
for intro andmiddle
andnext_only
for outro.This works if I have multiple articles but fails if I have only one, because the only article is both a next_only and a prev_only.
From my configuration, it inherits the two links which are broken because there is neither a previous article nor a next one.
I discovered that because all the articles of my series are currently draft except the first one.
You can reproduce that with the attached website:
series-intro-outro-test-website.zip
Running
zola serve -drafts
works as expected but runningzola serve
has the bad behavior.I know I could just wait to have multiple articles before commiting my code but all of this made me think we may be missing some templates
We could add a
has_prev
and ahas_next
templates.In terms of precedence, I would go for:
next_only
/middle
/prev_only
>has_prev
/has_next
>default
.I would be happy to get your thoughts about that.
I could have a look at implementing it if you think it is worth it.
Edit: I removed renaming of
next_only
andprev_only
(intofirst
,last
) after looking at the code.We should keep
next_only
andprev_only
for retro-compatibility but I would deprecate them in favor offirst
andlast
.Beta Was this translation helpful? Give feedback.
All reactions