Basically you write a macro, let's call it masterTemplate.
[#macro masterTemplate title="defaultTitle"]
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></meta>
<title>${title}</title>
... scripts, style sheets, meta information ...
</head>
<body>
<div id="header">...</div>
<div id="content">
[#nested /]
</div>
<div id="footer>...</div>
</body>
</html>
[/#macro]
Then, you use this macro within your pages like this:
[#import "/path/to/masterTemplate.ftl" as layout /]
[@layout.masterTemplate title="My test page"]
...content goes here...
[/@layout.masterTemplate]
You achieve some sort of decorating technique by passing all relevant data from the page as attribute to the masterTemplate: See the title attribute. In the same way you can pass additional scripts and stylesheets.
This technique is shown here: Freemarker wiki