]> git.ipfire.org Git - ipfire.org.git/commitdiff
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 53e644863e3da95a59258985d137f8b366093ec6..bb7d9e718386c0c6b6c37c768c4d4256914531e7 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 322348da28eb876979fe35b11c98db68dee96e89..b0a34eaf17c2d3034e4a99e2937d3a0aa35e76da 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 937a58230967494280d623566d858539f0dee0a7..97e5f21ca3dee6a7eb619d337843771a204cf139 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 021c15fc5c732890a6e87a332c091fc98ea24202..d9ee78a0737933013a28df20b0e7d276637e22f1 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">