Skip to content

Commit f63d3cb

Browse files
authored
Merge pull request #62 from LibreSign/feat/implement-sphinx-notfound-page
feat: implement sphinx-notfound-page
2 parents c0580c4 + feafa3e commit f63d3cb

File tree

5 files changed

+61
-82
lines changed

5 files changed

+61
-82
lines changed

admin_manual/conf.py

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
11
import os
22
import sys
33
import datetime
4-
sys.path.insert(0, os.path.abspath('.'))
5-
6-
now = datetime.datetime.now()
7-
8-
copyright = str(now.year) + ' LibreCode coop'
9-
project = 'LibreSign Documentation'
10-
author = 'LibreSign Team'
11-
release = '1.0'
12-
13-
extensions = [
14-
'sphinx_rtd_theme',
15-
'sphinx_rtd_dark_mode',
16-
'sphinx_copybutton',
17-
]
18-
19-
templates_path = ['_templates']
20-
exclude_patterns = []
21-
22-
html_theme = 'sphinx_rtd_theme'
23-
html_logo = "images/logo.png"
24-
html_theme_options = {
25-
'style_nav_header_background': '#184c4e',
26-
'logo_only': True,
27-
'navigation_with_keys': True,
28-
'style_external_links': True,
29-
'version_selector': False,
30-
}
4+
sys.path.insert(0, os.path.abspath('../'))
5+
from conf import *

conf.py

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import os
2+
import sys
3+
import datetime
4+
sys.path.insert(0, os.path.abspath('.'))
5+
6+
now = datetime.datetime.now()
7+
8+
copyright = str(now.year) + ' LibreCode coop'
9+
project = 'LibreSign Documentation'
10+
author = 'LibreSign Team'
11+
release = '1.0'
12+
13+
extensions = [
14+
'sphinx_rtd_theme',
15+
'sphinx_rtd_dark_mode',
16+
'sphinx_copybutton',
17+
'notfound.extension',
18+
]
19+
20+
templates_path = ['_templates']
21+
exclude_patterns = []
22+
23+
html_theme = 'sphinx_rtd_theme'
24+
html_logo = "images/logo.png"
25+
html_theme_options = {
26+
'style_nav_header_background': '#184c4e',
27+
'logo_only': True,
28+
'navigation_with_keys': True,
29+
'style_external_links': True,
30+
'version_selector': False,
31+
}
32+
html_extra_path = ['html']
33+
34+
# -- Options for sphinx-notfound-page extension -----------------------------------
35+
# https://github.com/readthedocs/sphinx-notfound-page
36+
37+
# content context passed to the 404 template
38+
notfound_context = {
39+
"title": "404 Page Not Found",
40+
"body": """
41+
<h1>Page Not Found</h1>
42+
<h2>Sorry, we can't seem to find the page you're looking for.</h2>
43+
<h6>Error code: 404</h6>
44+
45+
<h3>Here are some alternatives:</h3>
46+
<ol>
47+
<li>Try using the search box.</li>
48+
<li>Check the content menu on the side of this page.</li>
49+
<li>Regroup at our <a href="/">documentation homepage.</a></p></li>
50+
</ol>
51+
""",
52+
}
53+
54+
notfound_urls_prefix = None

developer_manual/conf.py

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,5 @@
11
import os
22
import sys
33
import datetime
4-
sys.path.insert(0, os.path.abspath('.'))
5-
6-
now = datetime.datetime.now()
7-
8-
copyright = str(now.year) + ' LibreCode coop'
9-
project = 'LibreSign Documentation'
10-
author = 'LibreSign Team'
11-
release = '1.0'
12-
13-
extensions = [
14-
'sphinx_rtd_theme',
15-
'sphinx_rtd_dark_mode',
16-
'sphinx_copybutton',
17-
]
18-
19-
templates_path = ['_templates']
20-
exclude_patterns = []
21-
22-
html_theme = 'sphinx_rtd_theme'
23-
html_logo = "images/logo.png"
24-
html_theme_options = {
25-
'style_nav_header_background': '#184c4e',
26-
'logo_only': True,
27-
'navigation_with_keys': True,
28-
'style_external_links': True,
29-
'version_selector': False,
30-
}
31-
html_extra_path = ['html']
4+
sys.path.insert(0, os.path.abspath('../'))
5+
from conf import *

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ sphinxcontrib-openapi==0.8.4
55
sphinxcontrib-redoc
66
sphinx-autobuild
77
sphinx-copybutton
8+
sphinx-notfound-page
89
docutils==0.21.2

user_manual/conf.py

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
11
import os
22
import sys
33
import datetime
4-
sys.path.insert(0, os.path.abspath('.'))
5-
6-
now = datetime.datetime.now()
7-
8-
copyright = str(now.year) + ' LibreCode coop'
9-
project = 'LibreSign Documentation'
10-
author = 'LibreSign Team'
11-
release = '1.0'
12-
13-
extensions = [
14-
'sphinx_rtd_theme',
15-
'sphinx_rtd_dark_mode',
16-
'sphinx_copybutton',
17-
]
18-
19-
templates_path = ['_templates']
20-
exclude_patterns = []
21-
22-
html_theme = 'sphinx_rtd_theme'
23-
html_logo = "images/logo.png"
24-
html_theme_options = {
25-
'style_nav_header_background': '#184c4e',
26-
'logo_only': True,
27-
'navigation_with_keys': True,
28-
'style_external_links': True,
29-
'version_selector': False,
30-
}
4+
sys.path.insert(0, os.path.abspath('../'))
5+
from conf import *

0 commit comments

Comments
 (0)