> For the complete documentation index, see [llms.txt](https://reyvaleza.gitbook.io/vibe.d-tutorial/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://reyvaleza.gitbook.io/vibe.d-tutorial/using-include-in-templates.md).

# Using include in templates

Oftentimes we need to break up our layout into smaller parts so that we can just include those smaller parts to compose a page. The **include** directive is just for that purpose.

Create **views\header.dt** and extract from **views\mainlayout.dt** this line:

```
h2 Welcome to our not so simple site
```

Then create **views\navbar.dt** and extract from **views\mainlayout.dt** this content:

```html
ul
  li <a href="/">Home</a>
  li <a href="/about">About us</a>
  li <a href="/events">Events</a>
  li <a href="/contact">Contact us</a>
  li <a href="/helloagain">Hello again!</a>
```

Then create **views\footer.dt** and extract from **views\mainlayout.dt** this line:

```
p Copyright 2022 Notsosimple Company
```

So what's left with **views\mainlayout.dt** is this:

```
html
  head
    title Demo site
  body
    header
      include header.dt
    nav
      include navbar.dt
    article
      block content
    footer
      include footer.dt
```

Compile, run and refresh the browser. If you see no changes, you did good again.<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://reyvaleza.gitbook.io/vibe.d-tutorial/using-include-in-templates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
