# thymeleaf

## 參考資料：

(<https://ithelp.ithome.com.tw/articles/10195168>)

Day 11-Spring Boot-如何載入靜態資源-使用thymeleaf模板引擎(<https://ithelp.ithome.com.tw/articles/10194825>)

## 如何引入 thymeleaf

build.gradle 的 dependencies 中加入

```
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
```

並且在 resources 新增兩個資料夾 static, templates ((可以自行取名

之後在設定檔加上上述兩個資料夾的讀取位置

```bash
spring.thymeleaf.prefix=classpath:/templates //放模板
spring.thymeleaf.static-locations=classpath:/static//放靜態檔案
```
