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

Simplify templates #3

Open
pitpalme opened this issue May 13, 2015 · 5 comments
Open

Simplify templates #3

pitpalme opened this issue May 13, 2015 · 5 comments

Comments

@pitpalme
Copy link
Contributor

Hello,

I'd like to simplify / optimize ThymeLeaf templates with respect to content.rootpath usage.
There's a bunch of redundancy in "th:with" for setting the rootpath to use.

If no objections come up I'd like to create a patch an open a pull request.

What's the general opinion about this?

Thanks and regards,
Peter

@jonbullock
Copy link
Member

Hi Peter,

Absolutely fine with me.

@msgilligan
Copy link

There are also three templates (index.thymeleaf, archive.thymeleaf, tags.thymeleaf) where the th:with is not used, resulting in bad links like: nullarchive.html. I was going to submit a PR that added three more instances of:

th:with="rootpath=(${content.rootpath != null} ? ${content.rootpath} : '')"

in order to correct that.

@pitpalme Do you have a pull request to simplify that (by defaulting to '' elsewhere) or should I go ahead and submit an (easier for a JBake beginner) PR that just modified the three template files to contain the redundant code?

Update: In tags.html, rootpath needs to be defaulted to '../' to work correctly -- and there's an even worse problem with the includes. Looks like this really does need to be solved in the (Java?) code that initializes content.rootpath

@jonbullock
Copy link
Member

Hi Sean the default value for rootpath should be ../ when rendering the tag files, that's set here: https://github.com/jbake-org/jbake/blob/master/src/main/java/org/jbake/app/Renderer.java#L233

Is this not the case?

@msgilligan
Copy link

I think my problem was caused by using version 2.4.0 of the bake command-line tool to initialize the project assets/templates/content, but configuring JBake 2.3.2 in my Gradle file. I created another project later using 2.4.0 consistently and did not have the problem.

@ottlinger
Copy link

@pitpalme any progress on the PR? I'd greatly appreciate a more up2date version of thymeleaf templates in the upcoming new release of jBake. Thanks

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

No branches or pull requests

4 participants