Skip to content

Commit

Permalink
Merge branch 'mogrify-favicon'
Browse files Browse the repository at this point in the history
* Branch commit log:
  package.json: remove icon-gen
  ui/Makefile.mk: use mogrify to create anklang.png and favicon.ico

Signed-off-by: Tim Janik <[email protected]>
  • Loading branch information
tim-janik committed Jun 25, 2024
2 parents cbee6b1 + bda875f commit 5993a34
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"eslint-plugin-vue": "^9.25.0",
"fork-awesome": "^1.2.0",
"globals": "^15.3.0",
"icon-gen": "^4.0.0",
"jsdoc": "^4.0.3",
"jsdoc-api": "^8.0.0",
"jsdoc-tsimport-plugin": "^1.0.5",
Expand Down
18 changes: 11 additions & 7 deletions ui/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,19 @@ $>/ui/markdown-it.mjs: node_modules/.npm.done | $>/ui/
&& rm -f $@.js
$>/.ui-build-stamp: $>/ui/markdown-it.mjs

# == $>/ui/anklang.png ==
$>/ui/anklang.png: ui/assets/favicon.svg ui/Makefile.mk | $>/ui/
$(QGEN)
$Q mkdir -p $>/ui-tmpanklpng/
$Q mogrify -density 600 -background transparent -resize 128x128 -format png -path $>/ui-tmpanklpng/ $<
$Q mv $>/ui-tmpanklpng/favicon.png $@.tmp && rm -r $>/ui-tmpanklpng/ && mv $@.tmp $@
$>/.ui-build-stamp: $>/ui/anklang.png

# == $>/ui/favicon.ico ==
$>/ui/favicon.ico: ui/assets/favicon.svg node_modules/.npm.done ui/Makefile.mk | $>/ui/
$>/ui/favicon.ico: $>/ui/anklang.png
$(QGEN)
$Q mkdir -p $>/ui/tmp-icongen/
$Q node_modules/.bin/icon-gen -i $< -o $>/ui/tmp-icongen/ --favicon --favicon-png-sizes 128 --favicon-ico-sizes 128 # -r
$Q cd $>/ui/tmp-icongen/ && mv favicon-128.png ../anklang.png && mv favicon.ico ../favicon.ico.tmp
$Q rm -r $>/ui/tmp-icongen/ && mv $@.tmp $@
$>/ui/anklang.png: $>/ui/favicon.ico
$>/.ui-build-stamp: $>/ui/favicon.ico $>/ui/anklang.png
$Q ln -s $(<F) $@
$>/.ui-build-stamp: $>/ui/favicon.ico

# == eslint ==
x11test.js ::= $(wildcard x11test/*.*js)
Expand Down

0 comments on commit 5993a34

Please sign in to comment.