Skip to content

Commit

Permalink
Use webjars-locator to avoid hardcoding versions of webjar dependenci…
Browse files Browse the repository at this point in the history
…es in the layout file
  • Loading branch information
wimdeblauwe committed Oct 18, 2023
1 parent 0908942 commit af0bf49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<!-- Web dependencies -->
<webjars-locator.version>0.46</webjars-locator.version>
<webjars-bootstrap.version>5.2.3</webjars-bootstrap.version>
<webjars-font-awesome.version>4.7.0</webjars-font-awesome.version>
<htmx.org.version>1.9.5</htmx.org.version>
Expand Down Expand Up @@ -94,6 +95,11 @@
</dependency>

<!-- webjars -->
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<version>${webjars-locator.version}</version>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>bootstrap</artifactId>
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/templates/fragments/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->

<link th:href="@{/webjars/font-awesome/4.7.0/css/font-awesome.min.css}" rel="stylesheet">
<link th:href="@{/webjars/font-awesome/css/font-awesome.min.css}" rel="stylesheet">
<link rel="stylesheet" th:href="@{/resources/css/petclinic.css}" />

</head>
Expand Down Expand Up @@ -92,9 +92,9 @@
</div>
</div>

<script th:src="@{/webjars/bootstrap/5.2.3/dist/js/bootstrap.bundle.min.js}"></script>
<script th:src="@{/webjars/htmx.org/1.9.5/dist/htmx.min.js}"></script>
<script th:src="@{/webjars/hyperscript.org/0.9.8/dist/_hyperscript.min.js}"></script>
<script th:src="@{/webjars/bootstrap/dist/js/bootstrap.bundle.min.js}"></script>
<script th:src="@{/webjars/htmx.org/dist/htmx.min.js}"></script>
<script th:src="@{/webjars/hyperscript.org/dist/_hyperscript.min.js}"></script>

</body>

Expand Down

0 comments on commit af0bf49

Please sign in to comment.