Skip to content

Commit 9b49ecd

Browse files
committed
Header content variables
1 parent 4d8d398 commit 9b49ecd

8 files changed

Lines changed: 390 additions & 69 deletions

File tree

docs/conf.py

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
from pathlib import Path
44
from urllib import request
5+
from yaml import safe_load
56

67
project = "Sphinx Book Theme"
78
copyright = "2020"
@@ -103,6 +104,8 @@
103104
"repository_branch": "master",
104105
}
105106

107+
header_config = safe_load(Path("./config-header.yml").read_text())
108+
106109
html_theme_options = {
107110
"path_to_docs": "docs",
108111
"repository_url": "https://github.com/executablebooks/sphinx-book-theme",
@@ -126,55 +129,8 @@
126129
"⚠️The latest release refactored our HTML, "
127130
"so double-check your custom CSS rules!⚠️"
128131
),
132+
"header": header_config,
129133
# For testing
130-
"header": {
131-
"brand": {
132-
"type": "image",
133-
"src": "https://executablebooks.org/en/latest/_static/logo.svg",
134-
"url": "https://sphinx-book-theme.readthedocs.io",
135-
},
136-
"start": [
137-
{
138-
"type": "text",
139-
"content": "Jupyter Book",
140-
"url": "https://jupyterbook.org",
141-
},
142-
{
143-
"type": "dropdown",
144-
"content": "EBP Projects",
145-
"items": [
146-
{"content": "google", "url": "https://google.com"},
147-
{"content": "jupyter", "url": "https://jupyter.org"},
148-
],
149-
},
150-
{
151-
"type": "dropdown",
152-
"content": "MyST Markdown",
153-
"items": [
154-
{"content": "google", "url": "https://google.com"},
155-
{"content": "jupyter", "url": "https://jupyter.org"},
156-
],
157-
},
158-
],
159-
"end": [
160-
{"type": "button", "content": "end", "url": "https://google.com"},
161-
{
162-
"type": "icon-links",
163-
"icons": [
164-
{
165-
"url": "https://twitter.com/executablebooks",
166-
"name": "Twitter",
167-
"icon": "fab fa-twitter-square",
168-
},
169-
{
170-
"url": "https://github.com/orgs/executablebooks/discussions",
171-
"name": "Forum",
172-
"icon": "fas fa-comments",
173-
},
174-
],
175-
},
176-
],
177-
}
178134
# "use_fullscreen_button": False,
179135
# "home_page_in_toc": True,
180136
# "single_page": True,

docs/config-header.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
brand:
2+
type: image
3+
src: https://executablebooks.org/en/latest/_static/logo.svg
4+
url: https://sphinx-book-theme.readthedocs.io
5+
start:
6+
- type: dropdown
7+
content: Projects
8+
items:
9+
- content: Jupyter Book
10+
url: https://jupyterbook.org
11+
- content: MyST Markdown
12+
url: https://myst-parser.readthedocs.io
13+
- content: MyST-NB
14+
url: https://myst-nb.readthedocs.io
15+
16+
- type: dropdown
17+
content: Community
18+
items:
19+
- content: Community guide
20+
url: https://executablebooks.org
21+
- content: Forum
22+
url: https://github.com/orgs/executablebooks/discussions
23+
- content: Feature Voting
24+
url: https://executablebooks.org/en/latest/feature-vote.html
25+
26+
end:
27+
- type: icon-links
28+
icons:
29+
- icon: fab fa-twitter-square
30+
name: Twitter
31+
url: https://twitter.com/executablebooks
32+
- icon: fab fa-github-square
33+
name: GitHub
34+
url: https://github.com/executablebooks
35+
- icon: fas fa-comments
36+
name: Forum
37+
url: https://github.com/orgs/executablebooks/discussions
38+
- type: button
39+
content: Book gallery
40+
url: http://gallery.jupyterbook.org/

0 commit comments

Comments
 (0)