I think you are looking for [8.3 Flexible layouts][1] The documantation is awesome and easy to follow, but here is also simple case for just inserting title string
layouts/layout.html
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" th:fragment="page(title)">
<head th:replace="fragments/head :: common_header(title=${title})"></head>
<body>
<div th:replace="this :: content"></div>