如何使用 Thymeleaf 在 Micronaut 中加载 CSS 文件?
这是我的index.html内容:
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Demo</title>
<link th:href="@{public/style.css}" type="text/css" rel="stylesheet" />
</head>
<body></body>
</html>
Run Code Online (Sandbox Code Playgroud)
这是application.yml:
router:
static:
resources:
default:
enabled: true
mapping: /**
paths: 'classpath:public'
Run Code Online (Sandbox Code Playgroud)
图片说明:
