mirror of
https://github.com/sudoxnym/brands.git
synced 2026-04-14 19:47:34 +00:00
Use icon@2x as logo@2x in case of a missing logo@2x and no dedicated logo is provided (#3235)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
4ca326492b
commit
99b1717446
2 changed files with 13 additions and 1 deletions
|
|
@ -55,7 +55,9 @@ For example: <`https://brands.home-assistant.io/[domain]/icon.png`>
|
|||
- If a domain is missing the `icon.png` file, 404 will be served
|
||||
- If a domain is missing the `logo.png` file, the `icon.png` is served instead (if available).
|
||||
- If a domain is missing the `icon@2x.png` file, the `icon.png` is served instead (if available).
|
||||
- If a domain is missing the `logo@2x.png` file, the `logo.png` is served instead (if available).
|
||||
- If a domain is missing the `logo@2x.png` file:
|
||||
- the `icon@2x.png` is served if available and `logo.png` is missing
|
||||
- the `logo.png` is served instead (if available).
|
||||
- If a image optimised for dark themes (image is prefixed with 'dark_') is missing, it's non-prefixed match will be served instead (if available).
|
||||
|
||||
### With placeholder fallback
|
||||
|
|
|
|||
|
|
@ -49,6 +49,16 @@ find ./build -type f -name "icon.txt" | while read icon; do
|
|||
echo "Generated mdi:${mdi} for ${icon}"
|
||||
done
|
||||
|
||||
# Use icon@2x as logo@2x in case of a missing logo@2x and no dedicated logo is provided for better resolution
|
||||
# This check must before the missing logo check
|
||||
find ./build -type f -name "icon@2x.png" | while read icon; do
|
||||
dir=$(dirname "${icon}")
|
||||
if [[ ! -f "${dir}/logo2x.png" && ! -f "${dir}/logo.png" ]]; then
|
||||
cp "${icon}" "${dir}/logo@2x.png"
|
||||
echo "Using ${icon} as hDPI logo because no logo is provided"
|
||||
fi
|
||||
done
|
||||
|
||||
# Use icon as logo in case of a missing logo
|
||||
find ./build -type f -name "icon.png" | while read icon; do
|
||||
dir=$(dirname "${icon}")
|
||||
|
|
|
|||
Loading…
Reference in a new issue