|
2 | 2 | import os |
3 | 3 | from pathlib import Path |
4 | 4 | from urllib import request |
| 5 | +from yaml import safe_load |
5 | 6 |
|
6 | 7 | project = "Sphinx Book Theme" |
7 | 8 | copyright = "2020" |
|
103 | 104 | "repository_branch": "master", |
104 | 105 | } |
105 | 106 |
|
| 107 | +header_config = safe_load(Path("./config-header.yml").read_text()) |
| 108 | + |
106 | 109 | html_theme_options = { |
107 | 110 | "path_to_docs": "docs", |
108 | 111 | "repository_url": "https://github.com/executablebooks/sphinx-book-theme", |
|
126 | 129 | "⚠️The latest release refactored our HTML, " |
127 | 130 | "so double-check your custom CSS rules!⚠️" |
128 | 131 | ), |
| 132 | + "header": header_config, |
129 | 133 | # 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 | | - } |
178 | 134 | # "use_fullscreen_button": False, |
179 | 135 | # "home_page_in_toc": True, |
180 | 136 | # "single_page": True, |
|
0 commit comments