Skip to content

Commit cd806d9

Browse files
Enhanced MkDocs configuration with updated theme settings, custom styling, and added a CI workflow for deployment.
1 parent 4d8e286 commit cd806d9

3 files changed

Lines changed: 129 additions & 11 deletions

File tree

.github/workflows/mkdocs.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: ci
2+
on:
3+
push:
4+
branches:
5+
- feature/DPAV-1838
6+
permissions:
7+
contents: write
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v5
13+
- name: Configure Git Credentials
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: 3.x
17+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
18+
- uses: actions/cache@v4
19+
with:
20+
key: mkdocs-material-${{ env.cache_id }}
21+
path: ~/.cache
22+
restore-keys: |
23+
mkdocs-material-
24+
- run: pip install mkdocs-material
25+
- run: mkdocs gh-deploy --force

docs/stylesheets/extra.css

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,49 @@
1616
--md-primary-fg-color--dark: #00152e;
1717
}
1818

19+
/* Increase logo size in the header */
20+
.md-header__button.md-logo img,
21+
.md-header__button.md-logo svg {
22+
height: 0.8rem; /* default is ~1.8rem; increase for better visibility */
23+
width: auto;
24+
}
25+
26+
/* Improve link readability in dark (slate) mode */
27+
[data-md-color-scheme="slate"] .md-typeset a:link {
28+
/* Light blue for high contrast on dark backgrounds */
29+
color: #8ab4f8;
30+
}
31+
[data-md-color-scheme="slate"] .md-typeset a:visited {
32+
/* Slightly desaturated/lighter to distinguish visited links */
33+
color: #b3c7ff;
34+
}
35+
[data-md-color-scheme="slate"] .md-typeset a:hover,
36+
[data-md-color-scheme="slate"] .md-typeset a:focus {
37+
color: #c4ddff;
38+
}
39+
/* Also adjust visited links in navigation (sidebar, toc) */
40+
[data-md-color-scheme="slate"] .md-nav__link:visited {
41+
color: #b3c7ff;
42+
}
43+
44+
/* Custom primary color for Material for MkDocs */
45+
46+
/* Light (default) scheme */
47+
:root {
48+
/* Primary brand color used for header, active nav, etc. */
49+
--md-primary-fg-color: #002244;
50+
/* Optional variants (used for hover/focus states) */
51+
--md-primary-fg-color--light: #2e4a6f;
52+
--md-primary-fg-color--dark: #00152e;
53+
}
54+
55+
/* Dark (slate) scheme */
56+
[data-md-color-scheme="slate"] {
57+
--md-primary-fg-color: #002244;
58+
--md-primary-fg-color--light: #2e4a6f;
59+
--md-primary-fg-color--dark: #00152e;
60+
}
61+
1962
/* Increase logo size in the header */
2063
.md-header__button.md-logo img,
2164
.md-header__button.md-logo svg {
@@ -40,3 +83,38 @@
4083
[data-md-color-scheme="slate"] .md-nav__link:visited {
4184
color: #b3c7ff;
4285
}
86+
87+
/* Footer styling: background #00152e and white text/links */
88+
.md-footer,
89+
.md-footer__inner,
90+
.md-footer-meta,
91+
.md-footer-meta__inner {
92+
background-color: #00152e !important;
93+
}
94+
95+
/* Ensure all footer text is white for readability */
96+
.md-footer,
97+
.md-footer * {
98+
color: #ffffff !important;
99+
}
100+
101+
/* Footer links states */
102+
.md-footer a,
103+
.md-footer a:visited {
104+
color: #ffffff !important;
105+
text-decoration: underline;
106+
}
107+
108+
.md-footer a:hover,
109+
.md-footer a:focus {
110+
color: #ffffff !important;
111+
opacity: 0.85;
112+
text-decoration: underline;
113+
}
114+
115+
/* Reduce header logo size for better balance */
116+
.md-header__button.md-logo img,
117+
.md-header__button.md-logo svg {
118+
height: 1.6rem !important; /* smaller than the previous 3.6rem */
119+
width: auto;
120+
}

mkdocs.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,32 @@ site_description: Federator is a middleware solution for connecting different tr
33
site_author: NDTP
44
site_url: https://www.ndtp.co.uk
55
repo_url: https://github.com/National-Digital-Twin/federator
6-
features:
7-
- content.action.edit
8-
- content.action.view
6+
edit_uri: edit/main/docs/
7+
theme:
8+
features:
99
- content.code.annotate
1010
- content.code.copy
1111
- content.code.select
1212
- content.tooltips
13-
- navigation.tabs
14-
- navigation.sections
15-
- navigation.footer
1613
- navigation.indexes
17-
- navigation.top
1814
- navigation.tracking
1915
- search.highlight
2016
- search.share
2117
- search.suggest
18+
- search.share
19+
- navigation.instant
20+
- navigation.instant.prefetch
21+
- navigation.instant
22+
- navigation.instant.progress
23+
- navigation.path
2224
- toc.follow
23-
theme:
25+
26+
2427
icon:
2528
repo: fontawesome/brands/github
26-
lang: en
29+
language: en
2730
name: material
28-
logo: assets/ndtp-logo.png
31+
logo: assets/light-page_header_logo.png
2932
favicon: assets/android-chrome-512x512-1-150x150.png
3033
palette:
3134
- media: "(prefers-color-scheme: light)"
@@ -44,22 +47,34 @@ theme:
4447
text: Roboto
4548
code: Roboto Mono
4649
markdown_extensions:
50+
- admonition
51+
- pymdownx.details
52+
- pymdownx.superfences
53+
- tables
4754
- pymdownx.highlight:
4855
anchor_linenums: true
4956
line_spans: __span
5057
pygments_lang_class: true
5158
- pymdownx.inlinehilite
5259
- pymdownx.snippets
5360
- pymdownx.superfences
61+
- pymdownx.superfences:
62+
custom_fences:
63+
- name: mermaid
64+
class: mermaid
65+
format: !!python/name:pymdownx.superfences.fence_code_format
5466
extra_css:
5567
- stylesheets/extra.css
5668
extra:
5769
version:
5870
provider: mike
71+
generator: false
5972
plugins:
73+
- include-markdown:
74+
rewrite_relative_urls: true
75+
- search
6076
- git-revision-date-localized:
6177
enabled: true
6278
copyright: |
6379
©Crown Copyright 2025. This work has been developed by the National Digital Twin Programme and is legally attributed to the Department for Business and Trade (UK) as the governing entity.
64-
<p>Licensed under the Open Government Licence v3.0.</p>
6580

0 commit comments

Comments
 (0)