A Pelican plugin that minifies fontawesome css and fonts to include only used icons.
git clone https://mcol.xyz/code/pelican-minify-fontawesome
Log | Files | Refs | README

commit 94d36eb5c5332e8e9a1b7ff93f39db139d4bbd1f
parent 8a84b1f05bfc4fe3cb4cdfdb93a7781ee7b8d101
Author: mcol <mcol@posteo.net>
Date:   Tue, 15 Oct 2019 00:24:26 +0100

remove loading of non-woff fonts from css

Diffstat:
Mminify_fontawesome.py | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/minify_fontawesome.py b/minify_fontawesome.py @@ -85,6 +85,12 @@ def copy_css(output_path, css_file): contents = fd.read() base_css = re.sub('\.fa-[\w-]+:before.*?}', '', contents) + for string in ['brands-400', 'regular-400', 'solid-900']: + base_css = re.sub( + f'src:url\(\.\./webfonts/fa-{string}\.eot\).*?\}}', + f'src:url(../webfonts/fa-{string}.woff) format("woff")}}', + base_css + ) css_blocks = [] for cls in get_classes(output_path):