@Matt, thank you very much for your help!!
But unfortunately I'm still very much lost.
I went into /usr/share/sphinx/themes/basic/layout.html (I think that's the
one I have to play with because of something I read about inheritance) but
there I only found an empty block named relbar1:
{%- block relbar1 %}{{ relbar() }}{% endblock %}
But I did find a part with a similar name and containing "Navigation":
{%- macro relbar() %}
<div class="related" role="navigation" aria-label="related navigation">
<h3>{{ _('Navigation') }}</h3>
<ul>
{%- for rellink in rellinks %}
<li class="right" {% if loop.first %}style="margin-right: 10px"{%
endif %}>
<a href="{{ pathto(rellink[0]) }}" title="{{
rellink[1]|striptags|e }}"
{{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a>
{%- if not loop.first %}{{ reldelim2 }}{% endif %}</li>
{%- endfor %}
{%- block rootrellink %}
<li class="nav-item nav-item-0"><a href="{{ pathto(master_doc)
}}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li>
{%- endblock %}
{%- for parent in parents %}
<li class="nav-item nav-item-{{ loop.index }}"><a href="{{
parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{
parent.title }}</a>{{ reldelim1 }}</li>
{%- endfor %}
{%- block relbaritems %} {% endblock %}
</ul>
</div>
{%- endmacro %}
So I decided to try with it. I copied all that part, but only that one, and
pasted it into a new file. I saved the file as
~/mySphinxProject/_templates/layout.html (If I understood correctly that is
the path and name it must have, please correct me if I am wrong).
On that new file, I replaced the following line
<h3>{{ _('Navigation') }}</h3>
with
<h3>{{ _('xxx') }}</h3>
After running make html, my output disappear, the webpage was completely
empty.
I deleted ~/mySphinxProject/_templates/layout.html but I keep having no
output at all, the wepage is still completely white.
I might be making more than one mistake... Any help is very much welcome!
By the way, what and where is something named templates_path ?
On Monday, October 19, 2020 at 3:06:22 PM UTC+2 Matt from Documatt wrote:
> It would be best if you learned a little about Sphinx themes. Themes
> contain templates like layout.html for page.html for regular documents,
> search.html for search results, etc. The most important template is
> layout.html. Templates contain blocks that are the smallest customizable
> parts. Based on your question, you want to override block "relbar1" in
> layout.html.
>
> Have a look at
> https://documatt.gitlab.io/sphinx-themes/learn_basic_theme_project/ to
> learn layout.html blocks.
>
> The official documentation has an excellent description and examples of
> overriding blocks:
> https://www.sphinx-doc.org/en/master/templating.html#jinja-sphinx-templating-primer
> .
>
> I recently blogged about this topic, too, at
> https://techwriter.documatt.com/sphinx-theming/index.html. Feel free to
> ask here!
>
> Matt
> https://techwriter.documatt.com
>
--
You received this message because you are subscribed to the Google Groups
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sphinx-users/3fcd3fe3-7e50-43e3-9672-c1b428eb9785n%40googlegroups.com.