mirror of
https://github.com/spirit-x64/scripts.git
synced 2024-11-24 00:33:11 +03:00
use icon
inestead of the legacy shortcut icon
This commit is contained in:
parent
941c19d8ce
commit
12f7168961
@ -28,7 +28,7 @@ if [[ -f "$html_file" ]]; then
|
|||||||
} else if (match($0, /<link rel="stylesheet" href="([^"]+\.css)">/)) {
|
} else if (match($0, /<link rel="stylesheet" href="([^"]+\.css)">/)) {
|
||||||
file = substr($0, RSTART+29, RLENGTH-31)
|
file = substr($0, RSTART+29, RLENGTH-31)
|
||||||
print "´"file"´\n"substr($0, RSTART+31+length(file))
|
print "´"file"´\n"substr($0, RSTART+31+length(file))
|
||||||
} else if (match($0, /<link rel="shortcut icon" type="image\/svg\+xml" href="([^"]+\.svg)">/)) {
|
} else if (match($0, /<link rel="icon" type="image\/svg\+xml" href="([^"]+\.svg)">/)) {
|
||||||
file = substr($0, RSTART+53, RLENGTH-55)
|
file = substr($0, RSTART+53, RLENGTH-55)
|
||||||
print "´SVG:"file"´\n"substr($0, RSTART+55+length(file))
|
print "´SVG:"file"´\n"substr($0, RSTART+55+length(file))
|
||||||
} else {
|
} else {
|
||||||
@ -47,7 +47,7 @@ if [[ -f "$html_file" ]]; then
|
|||||||
original_sizes=$(($original_sizes + $(stat -c %s $file)))
|
original_sizes=$(($original_sizes + $(stat -c %s $file)))
|
||||||
svgo "$file" -o "min.${file}"
|
svgo "$file" -o "min.${file}"
|
||||||
svg_content=$(cat "min.${file}" | sed 's/</\%3C/g; s/>/\%3E/g; s/#/\%23/g; s/"/'"'"'/g')
|
svg_content=$(cat "min.${file}" | sed 's/</\%3C/g; s/>/\%3E/g; s/#/\%23/g; s/"/'"'"'/g')
|
||||||
sed -i "s|´SVG:${file}´|<link rel=\"shortcut icon\" type=\"image/svg+xml\" href=\"data:image/svg+xml,${svg_content}\">|" "${html_file}.tmp"
|
sed -i "s|´SVG:${file}´|<link rel=\"icon\" type=\"image/svg+xml\" href=\"data:image/svg+xml,${svg_content}\">|" "${html_file}.tmp"
|
||||||
else
|
else
|
||||||
echo "Warning: SVG file $file not found."
|
echo "Warning: SVG file $file not found."
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user