added favicon

This commit is contained in:
eclipse 2025-02-14 12:01:46 +01:00
parent 0036bef3d4
commit c60eb9254d
22 changed files with 78 additions and 23 deletions

View File

@ -1,21 +0,0 @@
<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<style>
@font-face {
font-family: "LinBiolinum";
src: url("../fonts/LinLibertine/LinBiolinum_R.otf") format("opentype");
}
@font-face {
font-family: "LinBiolinum";
font-weight: bold;
src: url("../fonts/LinLibertine/LinBiolinum_RB.otf") format("opentype");
}
.tr {
font: bold 380px "LinBiolinum";
fill: #2d3138;
} </style>
<rect x="0" y="0" width="100%" height="100%" fill="white" />
<text x="32" y="392" class="tr">T</text>
<text x="208" y="392" class="tr">R</text>
</svg>

Before

Width:  |  Height:  |  Size: 560 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 298 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

BIN
content/favicon/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -0,0 +1,10 @@
<svg width="512" height="512" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg">
<style>
.tr {
fill: #2d3138;
}
</style>
<rect x="0" y="0" width="100%" height="100%" fill="white" />
<path id="t" class="tr" d="m 122.49857,213.31652 v 94.4 c 0,30 -0.8,58.4 -4,80 l 0.4,1.2 c 0,0 18.4,-1.2 32.4,-1.2 13.6,0 32,1.2 32,1.2 l 0.8,-1.2 c -3.2,-22.8 -4,-50 -4,-80 v -94.4 c 0,-6.8 0.4,-42.8 3.2,-52.4 53.6,0 81.6,8.8 81.6,8.8 l 0.8,-1.6 c -0.8,-6 -0.8,-27.2 0,-38.4 l -0.8,-1.2 c -6.4,0.8 -15.6,1.2 -24,1.2 H 61.698565 c -8.4,0 -17.6,-0.4 -24,-1.2 l -0.8,1.2 c 0.8,11.2 0.8,32.4 0,38.4 l 0.8,1.6 c 0,0 28,-8.8 81.600005,-8.8 2.8,9.6 3.2,45.6 3.2,52.4 z" />
<path id="r" class="tr" d="m 358.55961,146.92815 c 24.4,0 43.2,0.8 43.2,48 0,50 -18.4,52 -57.2,52 h -21.6 v -80.4 c 0,-11.6 7.2,-19.6 35.6,-19.6 z m -35.6,122.4 c 6.8,0 14.4,0 22.4,0 11.6,13.6 22,32.8 33.2,48 20,28.8 37.6,58 42,71.6 7.6,-1.2 23.6,-1.2 31.2,-1.2 8,0 29.2,0 37.2,1.2 l 0.8,-1.2 c -20.4,-22.8 -62,-92.4 -87.2,-125.6 33.6,-8.8 61.2,-27.2 61.2,-67.6 0,-25.6 -10,-43.2 -26,-54 -18.8,-12 -45.6,-13.6 -71.6,-13.6 -10,0 -58.4,2.8 -70.4,2.8 -13.6,0 -33.6,-1.2 -33.6,-1.2 l -0.8,1.2 c 3.2,22.8 4.8,50 4.8,80 v 98 c 0,30 -1.6,58.4 -4.8,80 l 0.4,1.2 c 0,0 18.4,-1.2 32.4,-1.2 13.6,0 32,1.2 32,1.2 l 0.8,-1.2 c -3.2,-22.8 -4,-50 -4,-80 z" />
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -12,7 +12,6 @@ DEFAULT_LANG = 'de'
THEME = "theme/" THEME = "theme/"
############################################################################### ###############################################################################
# URL & Path Settings # # URL & Path Settings #
############################################################################### ###############################################################################
@ -20,8 +19,15 @@ THEME = "theme/"
PATH = "content" PATH = "content"
ARTICLE_PATHS = ["posts"] ARTICLE_PATHS = ["posts"]
PAGE_PATHS = ["pages"] PAGE_PATHS = ["pages"]
STATIC_PATHS = ["images", "favicon"]
DIRECT_TEMPLATES = ['index', 'tags']
IGNORE_FILES = ['**/.*', '__pycache__', 'favicon-from-svg.sh']
EXTRA_PATH_METADATA = {
'favicon/favicon.ico': {'path': 'favicon.ico'},
}
#PATH_METADATA = '(?P<path_no_ext>.*)\..*'
PAGE_URL = '{slug}/' PAGE_URL = '{slug}/'
PAGE_SAVE_AS = '{slug}/index.html' PAGE_SAVE_AS = '{slug}/index.html'
ARTICLE_SAVE_AS = '{category}/{slug}.html' ARTICLE_SAVE_AS = '{category}/{slug}.html'

View File

@ -5,6 +5,7 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
{% include "includes/favicon.html" %}
<meta name="description" content="{% block metadesc %}{{ DEFAULT_METADESC|e }}{% endblock %}" /> <meta name="description" content="{% block metadesc %}{{ DEFAULT_METADESC|e }}{% endblock %}" />
<meta name="author" content="{{ AUTHOR }}" /> <meta name="author" content="{{ AUTHOR }}" />
<meta name="generator" content="Pelican" /> <meta name="generator" content="Pelican" />

View File

@ -0,0 +1,23 @@
<!-- basic svg -->
<link rel="icon" type="image/svg+xml" href="/favicon/favicon.svg">
<!-- generics -->
<link rel="icon" href="/favicon/favicon-16.png" sizes="16x16">
<link rel="icon" href="/favicon/favicon-32.png" sizes="32x32">
<link rel="icon" href="/favicon/favicon-48.png" sizes="48x48">
<link rel="icon" href="/favicon/favicon-128.png" sizes="128x128">
<link rel="icon" href="/favicon/favicon-192.png" sizes="192x192">
<!-- .ico files -->
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<!-- Android -->
<link rel="shortcut icon" href="/favicon/favicon-192.png" sizes="192x192">
<link rel="manifest" href="/favicon/manifest.json" />
<!-- iOS -->
<link rel="apple-touch-icon" href="/favicon/favicon-76.png" sizes="76x76">
<link rel="apple-touch-icon" href="/favicon/favicon-120.png" sizes="120x120">
<link rel="apple-touch-icon" href="/favicon/favicon-152.png" sizes="152x152">
<link rel="apple-touch-icon" href="/favicon/favicon-167.png" sizes="167x167">
<link rel="apple-touch-icon" href="/favicon/favicon-180.png" sizes="180x180">
<link rel="mask-icon" href="/favicon/favicon.svg" color="brown">
<!-- Windows -->
<meta name="msapplication-config" content="/browserconfig.xml" />

36
utils/favicon-from-svg.sh Executable file
View File

@ -0,0 +1,36 @@
#!/bin/bash
# Source: https://gessel.blackrosetech.com/2020/12/21/favicon-generation-script
# this makes the output verbose
set -ex
# collect the file name you entered on the command line (file.svg)
svg=$1
# set the sizes to be generated (plus 310x150 for msft)
size=(16 32 48 70 76 120 128 150 152 167 180 192 310 512)
# set the write director as a favicon directory below current
out="$(pwd)"
out+="/favicon"
mkdir -p $out
echo Making bitmaps from your svg...
for i in ${size[@]}; do
inkscape -o "$out/favicon-$i.png" -w $i -h $i $svg
done
# Microsoft wide icon (annoying, probably going away)
inkscape -o "$out/favicon-310x150.png" -w 310 -h 150 $svg
echo Compressing...
for f in $out/*.png; do pngquant -f --ext .png "$f" --posterize 4 --speed 1 ; done;
echo Creating favicon
convert $out/favicon-512.png -define icon:auto-resize=48,32,16 $out/favicon.ico
echo Done