Generate favicon.ico and Apple Icons from logo
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 18 Mar 2019 16:07:05 +0000 (16:07 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 18 Mar 2019 16:07:05 +0000 (16:07 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
.gitignore
Makefile.am
configure.ac
src/static/favicon.ico [deleted file]
src/templates/base.html

index 53e6448..bb7d9e7 100644 (file)
@@ -9,6 +9,8 @@
 /src/scss/main.css
 /src/scripts/ipfire.org
 /src/scripts/ipfire.org-webapp
+/src/static/favicon.ico
+/src/static/img/apple-touch-icon-*-precomposed.png
 /src/systemd/ipfire.org-webapp-*.service
 /ipfire.org.conf.sample
 Makefile
index 322348d..b0a34ea 100644 (file)
@@ -882,6 +882,14 @@ static_fonts_DATA = \
 static_fontsdir = $(staticdir)/fonts
 
 static_images_DATA = \
+       src/static/img/apple-touch-icon-192x192-precomposed.png \
+       src/static/img/apple-touch-icon-180x180-precomposed.png \
+       src/static/img/apple-touch-icon-152x152-precomposed.png \
+       src/static/img/apple-touch-icon-144x144-precomposed.png \
+       src/static/img/apple-touch-icon-120x120-precomposed.png \
+       src/static/img/apple-touch-icon-76x76-precomposed.png \
+       src/static/img/apple-touch-icon-72x72-precomposed.png \
+       src/static/img/apple-touch-icon-60x60-precomposed.png \
        src/static/img/default-avatar.jpg \
        src/static/img/ipfire-tux.png \
        src/static/img/iuse-not-found.png \
@@ -982,6 +990,16 @@ src/scss/main.css: $(SCSS_FILES) Makefile
        $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
                $(SASSC) --style compressed $< > $@
 
+src/static/favicon.ico: src/static/img/ipfire-tux.png Makefile
+       $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
+       $(CONVERT) $< -background none -flatten -density 1200 \
+               -define icon:auto-resize=64,48,32,16 $@
+
+src/static/img/apple-touch-icon-%-precomposed.png: src/static/img/ipfire-tux.png Makefile
+       $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
+       $(CONVERT) -background none -flatten -density 1200 -bordercolor none -border 5%x5% \
+               -resize $(patsubst src/static/img/apple-touch-icon-%-precomposed.png,%,$@) $< $@
+
 # Docker
 .PHONY: docker
 docker: Dockerfile
index 937a582..97e5f21 100644 (file)
@@ -31,6 +31,9 @@ AM_PATH_PYTHON([3.4])
 # scss
 AC_CHECK_PROG(SASSC, [sassc], [sassc])
 
+# convert from ImageMagick
+AC_CHECK_PROG(CONVERT, [convert], [convert])
+
 # ------------------------------------------------------------------------------
 
 AC_ARG_WITH([systemd],
diff --git a/src/static/favicon.ico b/src/static/favicon.ico
deleted file mode 100644 (file)
index 565ba7b..0000000
Binary files a/src/static/favicon.ico and /dev/null differ
index 021c15f..d9ee78a 100644 (file)
@@ -8,6 +8,12 @@
                <meta name="keywords" content="Linux, Firewall, IPFire, Security, IPCop, Open Source, Free, ARM, VPN, Proxy, IDS, IPS" />
                <meta name="description" content="{{ _("IPFire is a free firewall distribution based on Linux.") }}" />
 
+               <link rel="icon" sizes="192x192" href="{{ static_url("img/apple-touch-icon-192x192-precomposed.png") }}">
+               {% for res in ("72x72", "76x76", "120x120", "144x144", "152x152", "180x180") %}
+                       <link rel="apple-touch-icon-precomposed" sizes="{{ res }}" href="{{ static_url("img/apple-touch-icon-%s-precomposed.png" % res )}}">
+               {% end %}
+               <link rel="apple-touch-icon-precomposed" href="{{ static_url("img/apple-touch-icon-60x60-precomposed.png") }}">
+
                <!-- styling stuff -->
                <link rel="stylesheet" type="text/css" href="{{ static_url("main.css") }}" />
                <meta name="viewport" content="width=device-width, initial-scale=1.0">