Skip to content

block extracopyright not overriden #2508

@EdouardThiel

Description

@EdouardThiel

Hello,

extracopyright doesnt work for me:

  • I have added custom_dir: overrides after the material theme in mkdocs.yml
  • also added an overrides/main.html file:
{% extends "base.html" %}

{% block htmltitle %}
<title>This is a title</title>
{% endblock %}

{% block extracopyright %}
This is my extra copyright
{% endblock %}

The title works, but the extracopyright outputs nothing; that's because in base.html the block footer includes partials/footer.html and currently, includes doesn't override blocks.

Is it possible to correct the templates with a variable or a macro instead of a block extracopyright? or a special way to import footer.html ?

For instance replace the block in footer.html by

        Made with
        <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
          Material for MkDocs
        </a>
        {{ extracopyright }}

or even better, define extracopyright in the config (like copyright) and so in footer.hml it would be

        Made with
        <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
          Material for MkDocs
        </a>
        {{ config.extracopyright }}

without having to write an overrides/main.html file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue reports a bugresolvedIssue is resolved, yet unreleased if open

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions