# Template question title

**URL:** <https://zola.discourse.group/t/template-question-title/2350>\
**Category:** Support\
**Created:** [October 31, 2024, 3:45am UTC](https://zola.discourse.group/t/template-question-title/2350 "2024-10-31T03:45:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![KatSerf](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/katserf/32/1293_2.png) [@KatSerf](https://zola.discourse.group/u/KatSerf)\
**Post date:** [October 31, 2024, 3:45am UTC](https://zola.discourse.group/t/template-question-title/2350/1 "2024-10-31T03:45:39Z")

</div>

Hi all,

Trying to to have this in my templates/base.html file:

````auto
  <meta charset="utf-8">
  <title>{% title %}</title>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1.0.2/css/bulma.min.css">
</head>```

When I run zola serve from the command line it tells me: 
```Building site...
Error: Failed to serve the site
Error: Error parsing templates from the /templates directory
Error: Reason: 
* Failed to parse "/home/chris/ownCloud/Documents/sites/amber/templates/base.html"
 --> 6:10
  |
6 | <title>{% title %}</title>
  | ^---
  |
  = unexpected tag; expected end of input, a macro definition tag (`{% macro my_macro() %}`, or some content

````

Can anyone recommend how to fix this?

---

<div class="post-metadata">

**Author:** ![JeffPorter](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/jeffporter/32/1250_2.png) [@JeffPorter](https://zola.discourse.group/u/JeffPorter)\
**Post date:** [October 31, 2024, 7:26am UTC](https://zola.discourse.group/t/template-question-title/2350/2 "2024-10-31T07:26:51Z")

</div>

@KatSerf

I think it should be:

```auto
<title>{{ config.title }}</title> 

```

---

<div class="post-metadata">

**Author:** ![KatSerf](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/katserf/32/1293_2.png) [@KatSerf](https://zola.discourse.group/u/KatSerf)\
**Post date:** [October 31, 2024, 12:44pm UTC](https://zola.discourse.group/t/template-question-title/2350/3 "2024-10-31T12:44:52Z")

</div>

Hi Jeff,  
Thanks in case it wasn’t clear I want each md file to specify it’s own title. Was thinking it would go in the front matter would it still be config.title?

---

<div class="post-metadata">

**Author:** ![JeffPorter](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/jeffporter/32/1250_2.png) [@JeffPorter](https://zola.discourse.group/u/JeffPorter)\
**Post date:** [October 31, 2024, 2:34pm UTC](https://zola.discourse.group/t/template-question-title/2350/4 "2024-10-31T14:34:39Z")

</div>

Okay, you would then use something like the following in a template file:

```auto
{% extends "base.html" %}

{% block content %}
<article class="post">

  <h1 class="post-title"> **{{ page.title }}** </h1>

  <p>{{ page.date | date(format="%d %B %Y") }}</p>
  
    {% if page.taxonomies.tags %}
    tags:  
    {% for tag in page.taxonomies.tags %}
    <a href='{{ get_taxonomy_url(kind="tags", name=tag) | safe }}'>{{ tag }}</a>
    {%- if not loop.last %}{{ ", " | safe }}{% endif -%}
    {% endfor %}
    {% endif %}

    <div>
        {{ page.content | safe }}
    </div>

 </article>
{% endblock %}

```

---

<div class="post-metadata">

**Author:** ![JeffPorter](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/jeffporter/32/1250_2.png) [@JeffPorter](https://zola.discourse.group/u/JeffPorter)\
**Post date:** [October 31, 2024, 2:54pm UTC](https://zola.discourse.group/t/template-question-title/2350/5 "2024-10-31T14:54:06Z")

</div>

@katserf I should have explained: `{{ config.title }}` gets the title of your blog from config.toml.

The title of a blog or post is the example code I have given above. This should be in a template file, such as blog.html or post.html, depending on what you have called your section.

---

<div class="post-metadata">

**Author:** ![KatSerf](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/katserf/32/1293_2.png) [@KatSerf](https://zola.discourse.group/u/KatSerf)\
**Post date:** [October 31, 2024, 3:12pm UTC](https://zola.discourse.group/t/template-question-title/2350/6 "2024-10-31T15:12:56Z")

</div>

Thanks, I figured that is where the config.title is coming from.  
I’ll give your suggestion a shot!
