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

Archive page not grouping posts by month in thymeleaf template #5

Open
upkarlidder opened this issue Feb 12, 2017 · 2 comments
Open
Labels

Comments

@upkarlidder
Copy link

The archive page is showing the month for each th:each even though the posts belong to the same month. It renders the month header for each post instead of grouping them by month. Seems like the following line does not update the outer (outside the span) last_month variable.

<span th:remove='all' th:with='last_month = ${#dates.format(post.date,"MMMM yyyy")}'/>

https://github.com/jbake-org/jbake-example-project-thymeleaf/blob/master/templates/archive.thyme#L17

I am not sure how to fix this using thymeleaf only. If you can provide some hints, I will be happy to take a look and contribute back. Thank you !

@jonbullock
Copy link
Member

I'm not sure there is a simple fix to this having checked the Thymeleaf documentation, it doesn't look like you can alter the last_month variable from another tag, the span tag just sets another variable of the same name but in the scope of that span tag.

@jonbullock jonbullock added the bug label Apr 11, 2017
@jonbullock
Copy link
Member

Might be worth asking the Thymleaf forum: http://forum.thymeleaf.org/ or on Stackoverflow on how to achieve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants