Skip to content

Commit

Permalink
Use relative paths, so the site can be published at a URL that is not…
Browse files Browse the repository at this point in the history
… the domain root
  • Loading branch information
floscher committed Aug 26, 2024
1 parent 2ad85cb commit 19b51fb
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
8 changes: 4 additions & 4 deletions web/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<!DOCTYPE html>
<script type="module" src="/src/sipgator-app.ts"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/xml+svg" href="/favicon.svg">
<link rel="manifest" href="/app.webmanifest">
<link rel="icon" type="image/xml+svg" href="./favicon.svg">
<link rel="manifest" href="./app.webmanifest">
<title>Sipgator</title>
<style>
body.dark * {
Expand Down Expand Up @@ -82,7 +83,6 @@
--surface-container-highest:#ebe1d9;
}
</style>
<script src="/src/sipgator-app.ts" type="module"></script>
<link href="/beercss/beer.min.css" rel="stylesheet">
<link href="./beercss/beer.min.css" rel="stylesheet">
<!--<script src="/node_modules/beercss/dist/cdn/beer.min.js"></script>-->
<sipgator-app></sipgator-app>
4 changes: 2 additions & 2 deletions web/src/sipgator-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class SipgatorApp extends LitElement {
return html`
<nav class="bottom" style="justify-content: space-between;overflow-x: auto">
<header>
<img class="circle" src="/favicon.svg" alt="SipGator-Logo">
<img class="circle" src="./favicon.svg" alt="SipGator-Logo">
</header>
${
SipgatorApp.pages.map(p =>
Expand All @@ -41,7 +41,7 @@ export class SipgatorApp extends LitElement {
<sipgator-login .credential="${this.credential}" @credential-update="${this.handleCredentialUpdate}"></sipgator-login>
</span>
</nav>
<link href="/beercss/beer.min.css" rel="stylesheet">
<link href="./beercss/beer.min.css" rel="stylesheet">
<main class="responsive" style="margin-bottom: 8rem">
${ this.componentForPath(this.path) }
</main>
Expand Down
2 changes: 1 addition & 1 deletion web/src/sipgator-light-dark-switch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class SipgatorLightDarkSwitch extends LitElement {
<i>light_mode</i>
</span>
</label>
<link href="/beercss/beer.min.css" rel="stylesheet">
<link href="./beercss/beer.min.css" rel="stylesheet">
`
}
}
2 changes: 1 addition & 1 deletion web/src/sipgator-logged-out-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ export class SipgatorLoggedOutMessage extends LitElement {
</p>
</div>
</div>
<link href="/beercss/beer.min.css" rel="stylesheet">`
<link href="./beercss/beer.min.css" rel="stylesheet">`
}
}
2 changes: 1 addition & 1 deletion web/src/sipgator-login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export class SipgatorLogin extends LitElement {
</span>
</main>
</dialog>
<link href="/beercss/beer.min.css" rel="stylesheet">
<link href="./beercss/beer.min.css" rel="stylesheet">
`;
}

Expand Down
2 changes: 1 addition & 1 deletion web/src/sipgator-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export abstract class SipgatorPage extends LitElement {
return html`
<h1 class="small"><i class="extra padding">${ this.icon }</i>${ this.label }</h1>
${ when(this.credential, () => this.credential ? renderWithCredentials(this.credential) : fallback, () => fallback) }
<link rel="stylesheet" href="/beercss/beer.min.css" />
<link rel="stylesheet" href="./beercss/beer.min.css" />
`
}
}
7 changes: 5 additions & 2 deletions web/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { viteStaticCopy } from "vite-plugin-static-copy"
import compression from "vite-plugin-compression2"
export default {
import { defineConfig } from "vite"

export default defineConfig({
base: "",
plugins: [
viteStaticCopy({
targets: [
Expand All @@ -25,4 +28,4 @@ export default {
algorithm: "brotliCompress", exclude: [/\.br$/, /\.gz$/]
})
]
}
})

0 comments on commit 19b51fb

Please sign in to comment.