slightly better

This commit is contained in:
Curid 2022-06-04 16:10:26 +00:00
parent 86c132f9cd
commit f9b8d6ed1b
7 changed files with 47 additions and 27 deletions

View file

@ -4,6 +4,5 @@
// The actual config is dynamically generated server-side.
var config = {
appRoot: "/",
disallowedTopics: ["docs", "static", "file", "app", "settings"]
};

View file

@ -1,9 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<base>
<script>
// Calculate the root path.
const currentPath = "/" // Replaced by server.
const pathname = window.location.pathname
const lastIndex = pathname.lastIndexOf(currentPath)
var RootPath = pathname.slice(0, lastIndex+1)
console.log(`Root=${RootPath}`)
document.querySelector("base").href = RootPath;
</script>
<meta charset="UTF-8">
<title>ntfy web</title>
<!-- Mobile view -->
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@ -15,7 +25,7 @@
<meta name="apple-mobile-web-app-status-bar-style" content="#317f6f">
<!-- Favicon, see favicon.io -->
<link rel="icon" type="image/png" href="%PUBLIC_URL%/static/img/favicon.png">
<link rel="icon" type="image/png" href="static/img/favicon.png">
<!-- Previews in Google, Slack, WhatsApp, etc. -->
<meta property="og:type" content="website" />
@ -23,14 +33,14 @@
<meta property="og:site_name" content="ntfy web" />
<meta property="og:title" content="ntfy web" />
<meta property="og:description" content="ntfy lets you send push notifications via scripts from any computer or phone, entirely without signup or cost. Made with ❤ by Philipp C. Heckel, Apache License 2.0, source at https://heckel.io/ntfy." />
<meta property="og:image" content="%PUBLIC_URL%/static/img/ntfy.png" />
<meta property="og:image" content="static/img/ntfy.png" />
<meta property="og:url" content="https://ntfy.sh" />
<!-- Never index -->
<meta name="robots" content="noindex, nofollow" />
<!-- Fonts -->
<link rel="stylesheet" href="%PUBLIC_URL%/static/css/fonts.css" type="text/css">
<link rel="stylesheet" href="static/css/fonts.css" type="text/css">
</head>
<body>
<noscript>
@ -38,6 +48,6 @@
or <a href="https://ntfy.sh/docs/subscribe/phone/">Android/iOS app</a> to subscribe.
</noscript>
<div id="root"></div>
<script src="%PUBLIC_URL%/config.js"></script>
<script src="config.js"></script>
</body>
</html>