Skip to content

Commit 2f1d453

Browse files
docs: link back to source (#455)
* docs: link back to source Signed-off-by: Henry Schreiner <[email protected]> * style: pre-commit fixes --------- Signed-off-by: Henry Schreiner <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 6c40f22 commit 2f1d453

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

docs/pages/guides/docs.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ with code_fence("python"):
8282
from __future__ import annotations
8383

8484
import importlib.metadata
85+
from typing import Any
8586

8687
project = "package"
8788
copyright = "2024, My Name"
@@ -110,6 +111,24 @@ exclude_patterns = [
110111

111112
html_theme = "furo"
112113

114+
html_theme_options: dict[str, Any] = {
115+
"footer_icons": [
116+
{
117+
"name": "GitHub",
118+
"url": "https://github.com/org/package",
119+
"html": """
120+
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
121+
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path>
122+
</svg>
123+
""",
124+
"class": "",
125+
},
126+
],
127+
"source_repository": "https://github.com/org/package",
128+
"source_branch": "main",
129+
"source_directory": "docs/",
130+
}
131+
113132
myst_enable_extensions = [
114133
"colon_fence",
115134
]

{{cookiecutter.project_name}}/docs/conf.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

33
import importlib.metadata
4+
from typing import Any
45

56
project = "{{ cookiecutter.project_name }}"
67
copyright = "{{ cookiecutter.__year }}, {{ cookiecutter.full_name }}"
@@ -29,6 +30,26 @@
2930

3031
html_theme = "furo"
3132

33+
html_theme_options: dict[str, Any] = {
34+
{%- if cookiecutter.__ci == "github" %}
35+
"footer_icons": [
36+
{
37+
"name": "GitHub",
38+
"url": "{{ cookiecutter.url }}",
39+
"html": """
40+
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
41+
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path>
42+
</svg>
43+
""",
44+
"class": "",
45+
},
46+
],
47+
{%- endif %}
48+
"source_repository": "{{ cookiecutter.url }}",
49+
"source_branch": "main",
50+
"source_directory": "docs/",
51+
}
52+
3253
myst_enable_extensions = [
3354
"colon_fence",
3455
]

0 commit comments

Comments
 (0)