Skip to content

Commit 88a8de9

Browse files
authored
docs: Display license info in footer (#796)
# Description This PR adds license info to the footer of the docs. Sphinx Stack v2.0 aligns the copyright statement in the footer with legal standards, but this change was neglected in #794. Release notes prescription: ``` To incorporate this change in your documentation, add the license information to html_context in your conf.py file: html_context = { "license": { "name": "CC-BY-SA-3.0", "url": "https://github.com/canonical/sphinx-docs-starter-pack/blob/main/LICENSE", }, } ``` ## Type of change - Documentation update (change to documentation only) ## How has this been tested? Tested locally; build passes with no errors or warnings: make clean && make run: Builds and serves successfully make spelling: No spelling errors make woke: No inclusive language issues make linkcheck: No broken links <img width="1850" height="941" alt="image" src="https://github.com/user-attachments/assets/037c1a67-943f-4511-986c-ccc0a4a10705" /> ## Contributor checklist Please check that you have: - [x] self-reviewed the code in this PR - [x] added code comments, particularly in less straightforward areas - [ ] checked and added or updated relevant documentation - [ ] added or updated HTML meta descriptions for any new or modified documentation pages (see [#643](#643)) - N/A - [ ] verified that page title and headings accurately represent page content for new or modified documentation pages - N/A - [ ] checked and added or updated relevant release notes - [ ] added tests to verify effectiveness of this change Signed-off-by: Sharon Koech <sharon.koech@canonical.com>
1 parent ef92337 commit 88a8de9

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

docs/_templates/footer.html

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,26 @@
4141
<div class="copyright">
4242
{%- if hasdoc('copyright') %}
4343
{% trans path=pathto('copyright'), copyright=copyright|e -%}
44-
<a href="{{ path }}">Copyright</a> &#169; {{ copyright }}
44+
<a href="{{ path }}">&copy; {{ copyright }} {{ author }}</a>
4545
{%- endtrans %}
4646
{%- else %}
4747
{% trans copyright=copyright|e -%}
48-
Copyright &#169; {{ copyright }}
48+
&copy; {{ copyright }} {{ author }}
4949
{%- endtrans %}
5050
{%- endif %}
5151
</div>
5252
{%- endif %}
53+
{%- if license and license.name -%}
54+
{%- if license.url -%}
55+
<div class="license">
56+
This page is licensed under <a href="{{ license.url }}">{{ license.name }}</a>
57+
</div>
58+
{%- else -%}
59+
<div class="license">
60+
This page is licensed under {{ license.name }}
61+
</div>
62+
{%- endif -%}
63+
{%- endif -%}
5364

5465
{# mod: removed "Made with" #}
5566

@@ -89,4 +100,4 @@
89100
{% endif %}
90101
</div>
91102
<div class="right-details"><a href="" class="js-revoke-cookie-manager muted-link">Manage your tracker settings</a></div>
92-
</div>
103+
</div>

0 commit comments

Comments
 (0)