Skip to content

Commit c266e28

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

File tree

8 files changed

+166
-10
lines changed

8 files changed

+166
-10
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/conf.py renamed to docs/_sites/erda.dk/conf.py

+23-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
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+
sitevars, rst_epilog = _sitevars_and_epilog()
25+
project = "%s support" % (sitevars.project_name,)
726
copyright = "2023 SCIENCE HPC Center Support Team"
827
author = "SCIENCE HPC Center Support Team"
928

10-
1129
# -- General configuration ---------------------------------------------------
1230

1331
# Add any Sphinx extension module names here, as strings. They can be
@@ -27,7 +45,7 @@
2745
exclude_patterns = []
2846

2947
# HTML logo which will show on top of the sidebar
30-
html_logo = "_static/faelles.svg"
48+
html_logo = "../../_static/faelles.svg"
3149

3250
# -- Options for HTML output -------------------------------------------------
3351

@@ -39,7 +57,7 @@
3957
# Add any paths that contain custom static files (such as style sheets) here,
4058
# relative to this directory. They are copied after the builtin static files,
4159
# so a file named "default.css" will overwrite the builtin "default.css".
42-
html_static_path = ["_static"]
60+
html_static_path = ["../../_static"]
4361
html_css_files = ["custom.css"]
4462
# Favicon for browsertab etcetera
45-
html_favicon = '_static/favicon.ico'
63+
html_favicon = '../../_static/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

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
23+
# -- Project information -----------------------------------------------------
24+
25+
sitevars, rst_epilog = _sitevars_and_epilog()
26+
project = "%s support" % (sitevars.project_name,)
27+
copyright = "2023 SCIENCE HPC Center Support Team"
28+
author = "SCIENCE HPC Center Support Team"
29+
30+
31+
# -- General configuration ---------------------------------------------------
32+
33+
# Add any Sphinx extension module names here, as strings. They can be
34+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
35+
# ones.
36+
extensions = [
37+
"sphinx_rtd_theme",
38+
"sphinxemoji.sphinxemoji",
39+
]
40+
pygments_style = 'sphinx'
41+
# Add any paths that contain templates here, relative to this directory.
42+
templates_path = ["_templates"]
43+
44+
# List of patterns, relative to source directory, that match files and
45+
# directories to ignore when looking for source files.
46+
# This pattern also affects html_static_path and html_extra_path.
47+
exclude_patterns = []
48+
49+
# HTML logo which will show on top of the sidebar
50+
html_logo = "../../_static/faelles.svg"
51+
52+
# -- Options for HTML output -------------------------------------------------
53+
54+
# The theme to use for HTML and HTML Help pages. See the documentation for
55+
# a list of builtin themes.
56+
#
57+
html_theme = "sphinx_rtd_theme"
58+
59+
# Add any paths that contain custom static files (such as style sheets) here,
60+
# relative to this directory. They are copied after the builtin static files,
61+
# so a file named "default.css" will overwrite the builtin "default.css".
62+
html_static_path = ["../../_static"]
63+
html_css_files = []
64+
# Favicon for browsertab etcetera
65+
html_favicon = '../../_static/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/_sites/sif.ku.dk/conf.py

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
23+
# -- Project information -----------------------------------------------------
24+
25+
sitevars, rst_epilog = _sitevars_and_epilog()
26+
project = "%s support" % (sitevars.project_name,)
27+
copyright = "2023 SCIENCE HPC Center Support Team"
28+
author = "SCIENCE HPC Center Support Team"
29+
30+
31+
# -- General configuration ---------------------------------------------------
32+
33+
# Add any Sphinx extension module names here, as strings. They can be
34+
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
35+
# ones.
36+
extensions = [
37+
"sphinx_rtd_theme",
38+
"sphinxemoji.sphinxemoji",
39+
]
40+
pygments_style = 'sphinx'
41+
# Add any paths that contain templates here, relative to this directory.
42+
templates_path = ["_templates"]
43+
44+
# List of patterns, relative to source directory, that match files and
45+
# directories to ignore when looking for source files.
46+
# This pattern also affects html_static_path and html_extra_path.
47+
exclude_patterns = []
48+
49+
# HTML logo which will show on top of the sidebar
50+
html_logo = "../../_static/faelles.svg"
51+
52+
# -- Options for HTML output -------------------------------------------------
53+
54+
# The theme to use for HTML and HTML Help pages. See the documentation for
55+
# a list of builtin themes.
56+
#
57+
html_theme = "sphinx_rtd_theme"
58+
59+
# Add any paths that contain custom static files (such as style sheets) here,
60+
# relative to this directory. They are copied after the builtin static files,
61+
# so a file named "default.css" will overwrite the builtin "default.css".
62+
html_static_path = ["../../_static"]
63+
html_css_files = []
64+
# Favicon for browsertab etcetera
65+
html_favicon = '../../_static/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)