Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add main footer block #1351

Closed
rroblik opened this issue Nov 29, 2019 · 4 comments
Closed

Add main footer block #1351

rroblik opened this issue Nov 29, 2019 · 4 comments
Labels
change request Issue requests a new feature or improvement

Comments

@rroblik
Copy link

rroblik commented Nov 29, 2019

Hi,

Description

I asked myself how to easily add a "post article" custom content (right just before closing </article> (or after ?) BUT inside the <main> tag ?

Goal

My goal is to add static content on very page above the main content, at template level using native override capabilities.

Details

Add a main-footer block (maybe empty by default ?) here https://github.com/squidfunk/mkdocs-material/blob/master/src/base.html#L338, for example :

<!-- ... -->
<!-- Disqus integration -->
  {% block disqus %}
    {% include "partials/integrations/disqus.html" %}
  {% endblock %}
  {% block main-footer %}
    {% include "partials/main-footer.html" %}
  {% endblock %}
</article>
<!-- ... -->

or

<!-- ... -->
<!-- Disqus integration -->
  {% block disqus %}
    {% include "partials/integrations/disqus.html" %}
  {% endblock %}
</article>
{% block main-footer %}
  {% include "partials/main-footer.html" %}
{% endblock %}
<!-- ... -->

Do you think that is possible ?

Best regards

@squidfunk
Copy link
Owner

Well, we could do that for v5, but the question is: above or below Disqus? Probably a matter of taste.

@rroblik
Copy link
Author

rroblik commented Nov 29, 2019 via email

@squidfunk
Copy link
Owner

I would say before Disqus. But this is exactly my point - It's a matter of taste. For this reason I don't know if it makes sense including it, because then somebody else will open an issue who wants it just the other way. I'll leave this open until I/we decide.

@squidfunk squidfunk added the change request Issue requests a new feature or improvement label Dec 2, 2019
@squidfunk squidfunk mentioned this issue Jan 30, 2020
53 tasks
@squidfunk
Copy link
Owner

I decided not to include a generic main header or footer block. The reason is that there are multiple positions where such a block can be placed. However, it is easily achievable with the current architecture using block-level theme extension and the super() call:

Place after content, before disqus

{% block content %}
  <p>Main header</p>
  {{ super() }}
  <p>Main footer</p>
{% endblock %}

Place after disqus

{% block diqus %}
  {{ super() }}
  <p>Main footer</p>
{% endblock %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
change request Issue requests a new feature or improvement
Projects
None yet
Development

No branches or pull requests

2 participants