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 have started to develop my blog with JBake + Thymeleaf. When adding features, I discovered that you cannot update the value of a variable in thymeleaf. But, that is used in the templates/archive.thyme and templates/tags.thyme.
You set the variable and then update it, but that does not work. As soon as you leave scope, your variable is reset. So, after the span (so basically immediately) your last_month is null again. When you run the site, you will see that there is no grouping as with other techniques.
I really wanted grouping, so I updated the code to have this working. I hereby post my solution. The solution is similar for both pages, just updated published_posts with tag_posts, below is the code for archive.
Yes sure. I will clone and modify.
I have also launched another project on GitHub to get the startBootstrap
templates in JBake
https://github.com/vindevoy/startbootstrap-jbake-thymeleaf
Currently, develop is still empty. I have not yet finished the first
code block. Develop for me must be kept clean.
Branch is vindevoy-all-split
Jonathan Bullock wrote on 27/10/2018 10:53:
Hi,
I have started to develop my blog with JBake + Thymeleaf. When adding features, I discovered that you cannot update the value of a variable in thymeleaf. But, that is used in the templates/archive.thyme and templates/tags.thyme.
You set the variable and then update it, but that does not work. As soon as you leave scope, your variable is reset. So, after the span (so basically immediately) your last_month is null again. When you run the site, you will see that there is no grouping as with other techniques.
I really wanted grouping, so I updated the code to have this working. I hereby post my solution. The solution is similar for both pages, just updated published_posts with tag_posts, below is the code for archive.
My blog is still in development phase, but you can see the first results in http://dv.blog.yves.vindevogel.net. The final URL will be without the dv.
I have my own GitLab running, but I am pushing the changes on protected branches (develop and master) also to GitHub: https://github.com/vindevoy/blog-yves-vindevogel-net.git
Kr,
Yves Vindevogel (vindevoy)
The text was updated successfully, but these errors were encountered: