Chapter 2. Using Templates for Your Web Pages
Every website has some recurring elements, for example, a navigation bar and a header. A template engine enables you to put these elements in separate files and construct the whole page out of these files. The vibe.d includes a template engine, the so-called Diet templates.
In this chapter, you will learn the following:
- Why templates are useful
- Key concepts of Diet templates: inheritance, includes, and blocks
- How to use filters and how to create your own filter
- How to change the document type
- How to insert comments in a template
- How to localize a template
- Using D code in the templates