Template question title

Hi all,

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

  <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?

@KatSerf

I think it should be:

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

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?

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

{% 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 %}

@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.

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