Statac

Problems explained

Text never shown

error An error stops the build: nothing is published until it is fixed.

A template that extends another fills a block the other doesn’t have, so what the block holds appears on no page.

A template that starts {% extends "base" %} is built as base, with each of its blocks put in place of the block of the same name in base. A block base doesn’t have, nor any template base extends, has nowhere to go.

What you’ll see

error  Text never shown: `templates/base.html` has no block called `content`
  Did you mean `main`?
  More: https://statac.dev/e/text-never-shown/

In the terminal the message also names the file and line where there is one, and marks the exact text.

Why Statac stops

The block’s text would be left out of every page without a word, and Statac can’t tell whether the block’s name is a slip or the other template is missing a block.

How to fix it

Name the block as the template it extends does. When a block with a similar name is there, Statac offers it. If the other template should show it, add the block there.

Example

In templates/post.html:

{% extends "base" %}
{% block content %}{{ page.content }}{% endblock %}

If templates/base.html has {% block main %}{% endblock %}, write:

{% extends "base" %}
{% block main %}{{ page.content }}{% endblock %}

Its name

Nametext-never-shown
In the terminalstatac explain text-never-shown
To stop showing itIt stops the build, so it can't be quietened.

Something unclear or wrong? Open an issue on GitHub.