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
I would like to print a tag-index and using freemaker. The tag-index should print the number of posts per tag. I am doing it like this:
<#include "header.ftl">
<#include "menu.ftl">
<div class="page-header">
<h1>Tags</h1>
</div>
<ul>
<#list alltags as tag>
<li><a href="${tag.name}.html">${tag}</a> (${tag.tagged_posts?size})</li> <!-- THIS IS LINE 11 -->
</#list>
</ul>
<#include "footer.ftl">
I get the following error:
Failed to render tagindex
at org.jbake.launcher.Baker.bake(Baker.java:32)
at org.jbake.launcher.Main.run(Main.java:97)
at org.jbake.launcher.Main.run(Main.java:82)
at org.jbake.launcher.Main.main(Main.java:36)
Caused by: org.jbake.template.RenderingException: java.lang.Exception: Failed to render tags. Cause(s):
Failed to render tagindex
at org.jbake.render.TagsRenderer.render(TagsRenderer.java:20)
at org.jbake.app.Oven.bake(Oven.java:155)
at org.jbake.launcher.Baker.bake(Baker.java:20)
... 3 more
Caused by: java.lang.Exception: Failed to render tags. Cause(s):
Failed to render tagindex
at org.jbake.app.Renderer.renderTags(Renderer.java:386)
at org.jbake.render.TagsRenderer.render(TagsRenderer.java:18)
... 5 more
Caused by: java.lang.Exception: Failed to render tagindex
at org.jbake.app.Renderer.render(Renderer.java:239)
at org.jbake.app.Renderer.renderTags(Renderer.java:373)
... 6 more
Caused by: org.jbake.template.RenderingException: freemarker.core.NonHashException: For "." left-hand operand: Expected a hash, but this has evaluated to a string (wrapper: f.t.SimpleScalar):
==> atag [in template "tags-index.ftl" at line 11, column 40]
I am neither an expert on jbake nore freemaker but based on the jbake documentation that states that
alltags = collection of all tags used across all published content
and that
Global variable tags represent a collection of all tags. Each tag in this collection is represented by a map containing following attributes -
Expected:
I assumed that alltags would also give a map instead of tag-maps.
Actual:
alltags just contains a list of tag-strings
Is there a workaround? I.e. What is a way to get the posts for a tag? Or more specific the number of posts per tag?
The text was updated successfully, but these errors were encountered:
I wrote that section and even I had to double check the code after reading it again.
Documentation can always be improved and this is one example, a code snippet under that section would help immensely. I'll raise an issue on the web site to make sure it's done.
I would like to print a tag-index and using freemaker. The tag-index should print the number of posts per tag. I am doing it like this:
I get the following error:
I am neither an expert on jbake nore freemaker but based on the jbake documentation that states that
and that
Expected:
I assumed that alltags would also give a map instead of tag-maps.
Actual:
alltags just contains a list of tag-strings
Is there a workaround? I.e. What is a way to get the posts for a tag? Or more specific the number of posts per tag?
The text was updated successfully, but these errors were encountered: