Should we remove HTML attributes when using Thymeleaf?

I am studying Thymeleaf and found out that almost all examples have Thymeleaf tag values ​​as well as standard HTML values ​​such as:

<title th:text="#{product.page.title}">Page Title</title>

<link href="../static/css/bootstrap-3.3.7-dist/bootstrap.min.css" rel="stylesheet"
      th:href="@{/css/bootstrap-3.3.7-dist/bootstrap.css}"/>

<script src="../static/js/jquery-3.1.1.js"
        th:src="@{/js/jquery-3.1.1.js}"></script>

These standard tag values, such as Page Titleor href="../static/css/bootstrap-3.3.7-dist/bootstrap.min.css", etc., are ignored by the controller and are not displayed on the page.

I am wondering - is it just good practice to leave them to improve code reading or is it better to remove them to clear the code?

Because for the compiler, they are useless and do not affect the rendering result.

+2
source share
1 answer

It completely depends on your development process.

HTML , , .

, , /-, HTML, prod- ( ).

+2

Source: https://habr.com/ru/post/1666476/


All Articles