Skip to content

Commit

Permalink
Add support for multiple copyright statements
Browse files Browse the repository at this point in the history
  • Loading branch information
momostein committed Oct 25, 2024
1 parent fba58a4 commit 55540ef
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion alabaster/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,31 @@
{%- endif %}
{%- endblock %}

{%- macro pipe_split_copyright_block() %}
{%- if hasdoc('copyright') %}
{%- set copyright_prefix = '<a href="' + pathto('copyright') + '">' + _('Copyright') + '</a>' -%}
{%- else %}
{%- set copyright_prefix = _('Copyright') %}
{%- endif %}
{%- if copyright is iterable and copyright is not string %}
{% for copyright_line in copyright %}
{% trans trimmed copyright_prefix=copyright_prefix, copyright=copyright_line|e %}
&#169; {{ copyright_prefix }} {{ copyright }}.
{% endtrans %}
{% if not loop.last %}|{% endif %}
{% endfor %}
{%- else %}
{% trans trimmed copyright_prefix=copyright_prefix, copyright=copyright|e %}
&#169; {{ copyright_prefix }} {{ copyright }}.
{% endtrans %}
{%- endif %}
{%- endmacro %}

{%- block footer %}
<div class="footer">
{% if show_copyright %}&#169;{{ copyright }}.{% endif %}
{%- if show_copyright %}
{{- pipe_split_copyright_block() -}}
{%- endif %}
{% if show_sphinx %}
{% if show_copyright %}|{% endif %}
Powered by <a href="https://www.sphinx-doc.org/">Sphinx {{ sphinx_version }}</a>
Expand Down

0 comments on commit 55540ef

Please sign in to comment.