File tree Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 11<script lang =" ts" >
2+ import consts from ' $lib/consts' ;
3+
24 type Props = {
35 path? : string ;
46 };
57
6- const { path = ' /minifolio.png' }: Props = $props ();
8+ const { path }: Props = $props ();
9+
10+ const actualPath = path ? ` /data/${path } ` : consts .APP_ICON_URL ;
711 </script >
812
9- <link rel ="icon" href ={path } />
13+ <link rel ="icon" href ={actualPath } />
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ export const APP_NAME = 'Minifolio';
77/** Link to app's GitHub repo */
88export const APP_GITHUB = 'https://github.com/MaddyGuthridge/Minifolio' ;
99
10+ export const APP_ICON_URL = '/minifolio.png' ;
11+
1012/** Author info -- `[name, URL]` */
1113type AuthorInfo = [ string , string ] ;
1214
@@ -22,6 +24,7 @@ export const EDIT_COMMIT_HESITATION = 1_000;
2224export default {
2325 APP_NAME ,
2426 APP_GITHUB ,
27+ APP_ICON_URL ,
2528 APP_AUTHOR ,
2629 APP_CONTRIBUTORS ,
2730 EDIT_COMMIT_HESITATION ,
Original file line number Diff line number Diff line change 55 import api from ' $endpoints' ;
66 import consts from ' $lib/consts' ;
77 import DelayedUpdater from ' $lib/delayedUpdate' ;
8+ import itemId from ' $lib/itemId' ;
89 import type { ConfigJson } from ' $lib/server/data/config' ;
10+ import { itemFileUrl } from ' $lib/urls' ;
911
1012 type Props = {
1113 configJson: ConfigJson ;
3335 files ={imageFiles }
3436 onchange ={() => updater .update (config )}
3537 />
38+ {#if config .siteIcon }
39+ <p >
40+ Note: the image may be squashed/stretched by the browser when
41+ displayed in the address bar.
42+ </p >
43+ <div class =" site-icon-preview" >
44+ <img
45+ src ={itemFileUrl (itemId .ROOT , config .siteIcon )}
46+ alt ={' Preview of site icon' }
47+ />
48+ </div >
49+ {/if }
3650 </div >
3751
3852 <label for =" rel-me" ><h3 >Verification links</h3 ></label >
5165 />
5266 </form >
5367</div >
68+
69+ <style >
70+ .site-icon-preview {
71+ aspect-ratio : 1 / 1 ;
72+ max-width : 30% ;
73+ margin : 10px ;
74+ }
75+ .site-icon-preview > img {
76+ width : 100% ;
77+ height : 100% ;
78+ border-radius : 10px ;
79+ }
80+ </style >
You can’t perform that action at this time.
0 commit comments