Skip to content

Commit

Permalink
✨ Support site config logo, favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Oct 14, 2020
1 parent 4f77b24 commit 21b6f24
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/components/Nav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<div class="container">
{#if config['status-website'] && config['status-website'].logoUrl}
<div>
<a href="/" class="logo">
<a href={`${config['status-website'].logoHref} || "/"`} class="logo">
<img alt="" src={config['status-website'].logoUrl} />
<div>{config['status-website'].name}</div>
</a>
Expand Down
11 changes: 11 additions & 0 deletions src/routes/_layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
}
</style>

<svelte:head>
<link
rel="icon"
type="image/svg"
href={(config['status-website'] || {}).faviconSvg || (config['status-website'] || {}).favicon || `https://raw.githubusercontent.com/koj-co/upptime/master/assets/icon.svg`} />
<link
rel="icon"
type="image/png"
href={(config['status-website'] || {}).favicon || `/logo-192.png`} />
</svelte:head>

<Nav {segment} />

<main class="container">
Expand Down
30 changes: 13 additions & 17 deletions src/template.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="theme-color" content="#333333">
%sapper.base%
<link rel="stylesheet" href="global.css">
<link rel="manifest" href="manifest.json" crossorigin="use-credentials">
<link rel="icon" type="image/svg" href="https://raw.githubusercontent.com/koj-co/upptime/master/assets/icon.svg">
<link rel="icon" type="image/png" href="/logo-192.png">
%sapper.scripts%
%sapper.styles%
%sapper.head%
</head>
<body>
<div id="sapper">%sapper.html%</div>
</body>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<meta name="theme-color" content="#333333" />
%sapper.base%
<link rel="stylesheet" href="global.css" />
<link rel="manifest" href="manifest.json" crossorigin="use-credentials" />
%sapper.scripts% %sapper.styles% %sapper.head%
</head>
<body>
<div id="sapper">%sapper.html%</div>
</body>
</html>

0 comments on commit 21b6f24

Please sign in to comment.