Skip to content

Commit 80423aa

Browse files
committed
vimhelp: Add MacVim favicon
The favicon's were generated from the old MacVim.icns before we moved to the more squared off shape. Since we have the different sizes already available, modify the favicon logic to support different sizes for optimal browser behavior.
1 parent 0537065 commit 80423aa

File tree

8 files changed

+13
-2
lines changed

8 files changed

+13
-2
lines changed

vimhelp/scripts/h2h.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ def run(args):
145145
static_dir_rel = os.path.relpath(root_path / "static", args.out_dir)
146146
for target in (root_path / "static").iterdir():
147147
target_name = target.name
148-
if target_name == f"favicon-{args.project}.ico":
149-
src_name = "favicon.ico"
148+
if target_name.startswith(f"favicon-{args.project}"):
149+
src_name = target_name.replace(f"favicon-{args.project}", "favicon")
150150
elif target_name.startswith("favicon-"):
151151
continue
152152
else:

vimhelp/static/favicon-macvim-128.png

14.4 KB
Loading

vimhelp/static/favicon-macvim-16.png

1.67 KB
Loading

vimhelp/static/favicon-macvim-256.png

32 KB
Loading

vimhelp/static/favicon-macvim-32.png

4.05 KB
Loading

vimhelp/static/favicon-macvim-512.png

85.7 KB
Loading

vimhelp/static/favicon-macvim-64.png

6.5 KB
Loading

vimhelp/templates/page.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,18 @@
44
<meta name="viewport" content="width=device-width, initial-scale=1">
55
<meta name="description" content="{{project.name}} help pages, always up-to-date">
66
<title>{{project.name}}: {{filename}}</title>
7+
{% if project.name == 'MacVim' %}
8+
{# MacVim extension: Support variable size favicon's #}
9+
<link rel="shortcut icon" href="favicon-16.png">
10+
<link rel="icon" type="image/png" sizes="512x512" href="favicon-512.png">
11+
<link rel="icon" type="image/png" sizes="256x256" href="favicon-256.png">
12+
<link rel="icon" type="image/png" sizes="128x128" href="favicon-128.png">
13+
<link rel="icon" type="image/png" sizes="64x64" href="favicon-64.png">
14+
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32.png">
15+
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16.png">
16+
{% else %}
717
<link rel="shortcut icon" href="favicon.ico">
18+
{% endif %}
819
<!-- {{project.favicon_notice}} -->
920

1021
{% if mode != "offline" %}

0 commit comments

Comments
 (0)