bertramdev / asset-pipeline

The core implementation of the asset pipeline for the jvm
193 stars 92 forks source link

Added support for asset:* taglibs for asset-pipeline-spring-boot #61

Open dapriett opened 8 years ago

dapriett commented 8 years ago

Hi,

Is it possible to add support for the asset:javascript, asset:stylesheet, etc like you do for GSPs and the grails-asset-pipeline, but for asset-pipeline-spring-boot? Maybe add it as a thymeleaf tag-lib?

Thanks!

davydotcom commented 8 years ago

Would love to do this, boot supports several template engines so need to implement for several of them

dapriett commented 8 years ago

Maybe just JSPs to start, since that's probably used most. As long as at least one is supported, I think that would be good.

I was also looking at another similar asset manager called wro4j. I see they have a JSP taglib which maybe you can use as reference.

mkobel commented 5 years ago

I just created a simple taglib to replace the file url with the variant from the manifest file (with digest):

template.html:

<link asset:href="@{/assets/main.css} " th:rel="stylesheet"/>

compiled:

<link rel="stylesheet" href="/assets/main-f801ce4810c1852c646b2912e944d194.css"/>

The source is available here: https://github.com/itds-ch/asset-pipeline-thymeleaf-taglib

The package is available on jcenter: compile 'ch.itds.taglib:asset-pipeline-thymeleaf-taglib:1.0.0'

Feedback is welcome!