Skip to content

Commit 87f2d03

Browse files
committed
Implement a notion of multiple sites.
1 parent 8e1bf15 commit 87f2d03

File tree

8 files changed

+164
-9
lines changed

8 files changed

+164
-9
lines changed

Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
BRANDING := erda.dk
2+
CONFIGDIR = "./docs/_sites/$(BRANDING)"
13
SPHINXBUILD = ./.venv/bin/sphinx-build
2-
SPHINXOPTS =
4+
SPHINXOPTS = -c "$(CONFIGDIR)"
35
SOURCEDIR = docs
4-
BUILDDIR = build
6+
BUILDDIR = "build/$(BRANDING)"
57

68
# Put it first so that "make" without argument is like "make help".
79
.PHONY: help

docs/_sites/erda.dk/conf.py

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Configuration file for the modi-helper-scripts documentation site.
2+
# import sphinx_rtd_theme
3+
4+
from configparser import ConfigParser
5+
import os
6+
from types import SimpleNamespace
7+
8+
_SITE_DIR = os.path.dirname(os.path.abspath(__file__))
9+
10+
11+
def _sitevars_and_epilog():
12+
parser = ConfigParser()
13+
parser.read(os.path.join(_SITE_DIR, "variables.ini"))
14+
15+
sitevars = SimpleNamespace(**parser['site'])
16+
17+
epilog_lines = [".. |%s| replace:: %s" % (k, v) for k, v in sitevars.__dict__.items()]
18+
epilog = '\n'.join(epilog_lines)
19+
20+
return sitevars, epilog
21+
22+
# -- Project information -----------------------------------------------------
23+
24+
sitevars, rst_epilog = _sitevars_and_epilog()
25+
26+
# -- Project information -----------------------------------------------------
27+
28+
project = "%s support" % (sitevars.project_name,)
29+
copyright = "2023 SCIENCE HPC Center Support Team"
30+
author = "SCIENCE HPC Center Support Team"
31+
32+
# -- General configuration ---------------------------------------------------
33+
34+
# Add any Sphinx extension module names here, as strings. They can be
35+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
36+
# ones.
37+
extensions = [
38+
"sphinx_rtd_theme",
39+
"sphinxemoji.sphinxemoji",
40+
]
41+
pygments_style = 'sphinx'
42+
# Add any paths that contain templates here, relative to this directory.
43+
templates_path = ["_templates"]
44+
45+
# List of patterns, relative to source directory, that match files and
46+
# directories to ignore when looking for source files.
47+
# This pattern also affects html_static_path and html_extra_path.
48+
exclude_patterns = []
49+
50+
# HTML logo which will show on top of the sidebar
51+
html_logo = "_static/faelles.svg"
52+
53+
# -- Options for HTML output -------------------------------------------------
54+
55+
# The theme to use for HTML and HTML Help pages. See the documentation for
56+
# a list of builtin themes.
57+
#
58+
html_theme = "sphinx_rtd_theme"
59+
60+
# Add any paths that contain custom static files (such as style sheets) here,
61+
# relative to this directory. They are copied after the builtin static files,
62+
# so a file named "default.css" will overwrite the builtin "default.css".
63+
html_static_path = ["../../_static"]
64+
html_css_files = ["custom.css"]
65+
# Favicon for browsertab etcetera
66+
html_favicon = 'favicon.ico'

docs/_sites/erda.dk/variables.ini

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[site]
2+
project_name = ERDA & SIF

docs/_sites/generic/conf.py

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Configuration file for the modi-helper-scripts documentation site.
2+
# import sphinx_rtd_theme
3+
4+
from configparser import ConfigParser
5+
import os
6+
from types import SimpleNamespace
7+
8+
_SITE_DIR = os.path.dirname(os.path.abspath(__file__))
9+
10+
11+
def _sitevars_and_epilog():
12+
parser = ConfigParser()
13+
parser.read(os.path.join(_SITE_DIR, "variables.ini"))
14+
15+
sitevars = SimpleNamespace(**parser['site'])
16+
17+
epilog_lines = [".. |%s| replace:: %s" % (k, v) for k, v in sitevars.__dict__.items()]
18+
epilog = '\n'.join(epilog_lines)
19+
20+
return sitevars, epilog
21+
22+
# -- Project information -----------------------------------------------------
23+
24+
sitevars, rst_epilog = _sitevars_and_epilog()
25+
26+
project = "%s support" % (sitevars.project_name,)
27+
copyright = "2023 SCIENCE HPC Center Support Team"
28+
author = "SCIENCE HPC Center Support Team"
29+
30+
# -- General configuration ---------------------------------------------------
31+
32+
# Add any Sphinx extension module names here, as strings. They can be
33+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
34+
# ones.
35+
extensions = [
36+
"sphinx_rtd_theme",
37+
"sphinxemoji.sphinxemoji",
38+
]
39+
pygments_style = 'sphinx'
40+
# Add any paths that contain templates here, relative to this directory.
41+
templates_path = ["_templates"]
42+
43+
# List of patterns, relative to source directory, that match files and
44+
# directories to ignore when looking for source files.
45+
# This pattern also affects html_static_path and html_extra_path.
46+
exclude_patterns = []
47+
48+
# HTML logo which will show on top of the sidebar
49+
html_logo = "../../_static/faelles.svg"
50+
51+
# -- Options for HTML output -------------------------------------------------
52+
53+
# The theme to use for HTML and HTML Help pages. See the documentation for
54+
# a list of builtin themes.
55+
#
56+
html_theme = "sphinx_rtd_theme"
57+
58+
# Add any paths that contain custom static files (such as style sheets) here,
59+
# relative to this directory. They are copied after the builtin static files,
60+
# so a file named "default.css" will overwrite the builtin "default.css".
61+
html_static_path = ["../../_static"]
62+
html_css_files = []
63+
# Favicon for browsertab etcetera
64+
html_favicon = 'favicon.ico'

docs/_sites/generic/variables.ini

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[site]
2+
project_name = Generic

docs/conf.py renamed to docs/_sites/sif.ku.dk/conf.py

+21-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
11
# Configuration file for the modi-helper-scripts documentation site.
22
# import sphinx_rtd_theme
33

4+
from configparser import ConfigParser
5+
import os
6+
from types import SimpleNamespace
7+
8+
_SITE_DIR = os.path.dirname(os.path.abspath(__file__))
9+
10+
11+
def _sitevars_and_epilog():
12+
parser = ConfigParser()
13+
parser.read(os.path.join(_SITE_DIR, "variables.ini"))
14+
15+
sitevars = SimpleNamespace(**parser['site'])
16+
17+
epilog_lines = [".. |%s| replace:: %s" % (k, v) for k, v in sitevars.__dict__.items()]
18+
epilog = '\n'.join(epilog_lines)
19+
20+
return sitevars, epilog
21+
422
# -- Project information -----------------------------------------------------
523

6-
project = "ERDA & SIF support"
24+
project = "%s support" % (project_name,)
725
copyright = "2023 SCIENCE HPC Center Support Team"
826
author = "SCIENCE HPC Center Support Team"
927

10-
1128
# -- General configuration ---------------------------------------------------
1229

1330
# Add any Sphinx extension module names here, as strings. They can be
@@ -39,7 +56,7 @@
3956
# Add any paths that contain custom static files (such as style sheets) here,
4057
# relative to this directory. They are copied after the builtin static files,
4158
# so a file named "default.css" will overwrite the builtin "default.css".
42-
html_static_path = ["_static"]
59+
html_static_path = ["../../_static"]
4360
html_css_files = ["custom.css"]
4461
# Favicon for browsertab etcetera
45-
html_favicon = '_static/favicon.ico'
62+
html_favicon = 'favicon.ico'

docs/_sites/sif.ku.dk/variables.ini

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[site]
2+
project_name = Secure Information Facility

docs/index.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _index-start:
22

3-
ERDA/SIF: User Guides
4-
=====================
3+
|project_name|: User Guides
4+
===========================
55

66
.. toctree::
77
:maxdepth: 2
@@ -39,7 +39,7 @@ Welcome to the documentation site for ERDA and SIF! `ERDA <https://erda.ku.dk/>`
3939

4040
To quickly get started with ERDA or SIF, we recommend our :ref:`getting-started` page. If you are looking for something specific, the search functionality and the sidebar on the left is a good way to find what you are looking for!
4141

42-
|:file_cabinet:| About ERDA
42+
|:file_cabinet:| About |project_name|
4343
ERDA (Electronic Research Data Archive) at the University of Copenhagen (KU/UCPH) is meant for storing,
4444
sharing, analyzing and archiving research data. ERDA delivers safe central storage space for ones own
4545
and shared files, interactive analysis tools in addition to archiving for safe-keeping and publishing.

0 commit comments

Comments
 (0)