fix(webui): favicon for iOS, Android and Windows 10 (#547)

This commit is contained in:
Ben Kuskopf 2021-06-01 10:39:09 +10:00 committed by GitHub
parent 14a974c8ae
commit da99052954
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 34 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -6,6 +6,11 @@
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Komga</title> <title>Komga</title>
<link rel="icon" href="/favicon.ico" th:href="@{/favicon.ico}"> <link rel="icon" href="/favicon.ico" th:href="@{/favicon.ico}">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" th:href="@{/apple-touch-icon.png}">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" th:href="@{/favicon-32x32.png}">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" th:href="@{/favicon-16x16.png}">
<meta name="msapplication-TileColor" content="#08397f">
<meta name="msapplication-TileImage" th:content="@{/mstile-144x144.png}" content="/mstile-144x144.png">
<script th:inline="javascript"> <script th:inline="javascript">
/*<![CDATA[*/ /*<![CDATA[*/
window.resourceBaseUrl = /*[(<%="$"%>{"'" + baseUrl + "'"})]*/ '/' window.resourceBaseUrl = /*[(<%="$"%>{"'" + baseUrl + "'"})]*/ '/'

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -17,6 +17,12 @@ module.exports = {
} }
return false return false
}, },
'th:content': function (tag) {
if (_.has(tag, 'attributes.content')) {
return `@{${tag.attributes.content}}`
}
return false
},
'th:src': function (tag) { 'th:src': function (tag) {
if (_.has(tag, 'attributes.src')) { if (_.has(tag, 'attributes.src')) {
return `@{${tag.attributes.src}}` return `@{${tag.attributes.src}}`

View file

@ -82,6 +82,13 @@ class SecurityConfiguration(
"/img/**", "/img/**",
"/js/**", "/js/**",
"/favicon.ico", "/favicon.ico",
"/favicon-16x16.png",
"/favicon-32x32.png",
"/mstile-144x144.png",
"/apple-touch-icon.png",
"/apple-touch-icon-180x180.png",
"/android-chrome-192x192.png",
"/android-chrome-512x512.png",
"/", "/",
"/index.html" "/index.html"
) )

View file

@ -30,11 +30,25 @@ class WebMvcConfiguration : WebMvcConfigurer {
registry registry
.addResourceHandler( .addResourceHandler(
"/index.html", "/index.html",
"/favicon.ico" "/favicon.ico",
"/favicon-16x16.png",
"/favicon-32x32.png",
"/mstile-144x144.png",
"/apple-touch-icon.png",
"/apple-touch-icon-180x180.png",
"/android-chrome-192x192.png",
"/android-chrome-512x512.png"
) )
.addResourceLocations( .addResourceLocations(
"classpath:public/index.html", "classpath:public/index.html",
"classpath:public/favicon.ico" "classpath:public/favicon.ico",
"classpath:public/favicon-16x16.png",
"classpath:public/favicon-32x32.png",
"classpath:public/mstile-144x144.png",
"classpath:public/apple-touch-icon.png",
"classpath:public/apple-touch-icon-180x180.png",
"classpath:public/android-chrome-192x192.png",
"classpath:public/android-chrome-512x512.png"
) )
.setCacheControl(CacheControl.noStore()) .setCacheControl(CacheControl.noStore())