Layouts

base.html

<!doctype html>
<html lang="en" xmlns:th="<http://www.thymeleaf.org>" th:fragment="base(content)">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Demo Site</title>
    <link rel="stylesheet" href="<https://cdn.jsdelivr.net/npm/[email protected]/dist/minty/bootstrap.min.css>">
    <script src="<https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js>"></script>
</head>
<body>
<header>
    <h1>Welcome to the Demo Site</h1>

    <nav>
        <a th:href="@{/}">Home</a>
        <a th:href="@{/users}">Users</a>
    </nav>
</header>
<main>
    <th:block th:replace="${content}"></th:block>
</main>
</body>
</html>

home.html

<!DOCTYPE html>
<html lang="en" xmlns:th="<http://www.thymeleaf.org>" th:replace="~{base :: base(~{::section})}">
<head>
    <meta charset="UTF-8">
    <title>Home</title>
</head>
<body>
<section>
    <b>Home Page</b>
</section>
</body>
</html>