File tree Expand file tree Collapse file tree 4 files changed +34
-6
lines changed
canonical_sphinx/theme/templates Expand file tree Collapse file tree 4 files changed +34
-6
lines changed Original file line number Diff line number Diff line change 4343 < div class ="copyright ">
4444 {%- if hasdoc('copyright') %}
4545 {% trans path=pathto('copyright'), copyright=copyright|e -%}
46- < a href ="{{ path }} "> Copyright </ a > © ; {{ copyright }}
46+ < a href ="{{ path }} "> © ; {{ copyright }} {{ author }} </ a >
4747 {%- endtrans %}
4848 {%- else %}
4949 {% trans copyright=copyright|e -%}
50- Copyright © ; {{ copyright }}
50+ © ; {{ copyright }} {{ author }}
5151 {%- endtrans %}
5252 {%- endif %}
5353 </ div >
5454 {%- endif %}
55+ {%- if license and license.name -%}
56+ {%- if license.url -%}
57+ < div class ="license ">
58+ This page is licensed under < a href ="{{ license.url }} "> {{ license.name }}</ a >
59+ </ div >
60+ {%- else -%}
61+ < div class ="license ">
62+ This page is licensed under {{ license.name }}
63+ </ div >
64+ {%- endif -%}
65+ {%- endif -%}
5566
5667 {# mod: removed "Made with" #}
5768
Original file line number Diff line number Diff line change 44# https://www.sphinx-doc.org/en/master/usage/configuration.html
55
66project = "canonical-sphinx"
7- copyright = "2024, Canonical "
8- author = "Canonical"
7+ copyright = "2024"
8+ author = "Canonical Ltd. "
99
1010extensions = [
1111 "canonical_sphinx" ,
1212]
1313
1414html_context = {
15+ "author" : author ,
1516 "product_page" : "github.com/canonical/canonical-sphinx" ,
1617 "github_url" : "https://github.com/canonical/canonical-sphinx" ,
18+ "license" : {
19+ "name" : "LGPL-3.0-only" ,
20+ "url" : "test.com" ,
21+ },
1722}
1823
1924html_theme_options = {
Original file line number Diff line number Diff line change 4040# curl -H 'Authorization: token <TOKEN>' \
4141# -H 'Accept: application/vnd.github.v3.raw' \
4242# https://api.github.com/repos/canonical/<REPO> | jq '.created_at'
43- copyright = f"{ datetime .today ().year } , { author } "
43+ copyright = f"{ datetime .today ().year } "
4444
4545# Set the path to your own static assets here
4646html_static_path = ["_static" ]
5757 # header) to ".sphinx/_static" and change the path here (start with "_static")
5858 # (default is the circle of friends)
5959 "product_tag" : "_static/example-tag.png" ,
60+ # Inherit the author value
61+ "author" : author ,
62+ # Change your product's license name and a link to its file.
63+ # For the name, we recommend using the standard shorthand identifier from
64+ # https://spdx.org/licenses
65+ # For the URL, link directly to the canonical license statement, typically found on
66+ # the product's home page or in its GitHub project.
67+ #
68+ "license" : {
69+ "name" : "LGPL-3.0-only" ,
70+ "url" : "https://github.com/canonical/sphinx-docs-starter-pack/blob/main/LICENSE" ,
71+ },
6072 # Change to the discourse instance you want to be able to link to
6173 # using the :discourse: metadata at the top of a file
6274 # (use an empty value if you don't want to link)
Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ def test_canonical_sphinx(example_project):
5959 # Copyright
6060 copyright_ = soup .find ("div" , {"class" : "copyright" }).string .strip ()
6161 year = datetime .today ().year
62- assert copyright_ == f"Copyright © { year } , Example Project Authors"
62+ assert copyright_ == f"© { year } Example Project Authors"
6363
6464 # Logo
6565 logo = soup .find ("a" , {"class" : "p-logo" })
You can’t perform that action at this time.
0 commit comments