Skip to content

Commit 6b2d53f

Browse files
committed
Add favicon.
1 parent 425bf25 commit 6b2d53f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

preprocess.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ def rearrange_archive(root):
7474
# also copy the custom fonts
7575
shutil.copy(os.path.join(path, 'DejaVuSansMonoCondensed60.ttf'), data_path)
7676
shutil.copy(os.path.join(path, 'DejaVuSansMonoCondensed75.ttf'), data_path)
77+
# and the favicon
78+
shutil.copy(os.path.join(path, 'favicon.ico'), data_path)
7779

7880
# remove what's left
7981
shutil.rmtree(path)
@@ -185,6 +187,9 @@ def preprocess_html_file(root, fn, rename_map):
185187
for el in html.xpath('/html/head/link'):
186188
if el.get('rel') in [ 'alternate', 'search', 'edit', 'EditURI' ]:
187189
el.getparent().remove(el)
190+
elif el.get('rel') == 'shortcut icon':
191+
(head, tail) = os.path.split(el.get('href'))
192+
el.set('href', os.path.join(head, 'common', tail))
188193

189194
# remove Google Analytics scripts
190195
for el in html.xpath('/html/body/script'):

0 commit comments

Comments
 (0)