mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-04 09:02:50 +00:00
pwa adjustments
This commit is contained in:
@@ -28,7 +28,7 @@
|
|||||||
</abbr>
|
</abbr>
|
||||||
{/if}
|
{/if}
|
||||||
<a
|
<a
|
||||||
href="/device-manager"
|
href="/device-manager/"
|
||||||
title="Device Manager"
|
title="Device Manager"
|
||||||
class="icon connect"
|
class="icon connect"
|
||||||
class:error={$serialPort === undefined}
|
class:error={$serialPort === undefined}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export const prerender = true
|
export const prerender = true
|
||||||
|
|
||||||
export const trailingSlash = "never"
|
export const trailingSlash = "always"
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ import {redirect} from "@sveltejs/kit"
|
|||||||
|
|
||||||
/** @type {import("./$types").PageLoad} */
|
/** @type {import("./$types").PageLoad} */
|
||||||
export function load() {
|
export function load() {
|
||||||
throw redirect(302, "/config")
|
throw redirect(302, "/config/")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
import {page} from "$app/stores"
|
import {page} from "$app/stores"
|
||||||
|
|
||||||
const paths = [
|
const paths = [
|
||||||
{href: "/config/chords", title: "Chords", icon: "piano"},
|
{href: "/config/chords/", title: "Chords", icon: "piano"},
|
||||||
{href: "/config/layout", title: "Layout", icon: "keyboard"},
|
{href: "/config/layout/", title: "Layout", icon: "keyboard"},
|
||||||
{href: "/config/settings", title: "Settings", icon: "settings"},
|
{href: "/config/settings/", title: "Settings", icon: "settings"},
|
||||||
]
|
]
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ import {redirect} from "@sveltejs/kit"
|
|||||||
|
|
||||||
/** @type {import("./$types").PageLoad} */
|
/** @type {import("./$types").PageLoad} */
|
||||||
export function load() {
|
export function load() {
|
||||||
throw redirect(302, "/config/chords")
|
throw redirect(302, "/config/chords/")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,12 @@
|
|||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
|
|
||||||
# force https
|
# force https
|
||||||
RewriteCond %{HTTPS} !=on
|
RewriteCond %{HTTPS} off
|
||||||
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
|
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
|
||||||
|
|
||||||
# remove trailing slash
|
# https://kit.svelte.dev/docs/single-page-apps#apache
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
|
||||||
RewriteRule ^(.*)/$ /$1 [L,R] # R=301
|
|
||||||
|
|
||||||
# SPA mode
|
|
||||||
RewriteBase /
|
RewriteBase /
|
||||||
RewriteRule ^200\.html$ - [L]
|
RewriteRule ^200\.html$ - [L]
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
RewriteRule . /200.html [L]
|
RewriteRule . /200.html [L]
|
||||||
|
|
||||||
# redirect not found urls to .html files
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
|
||||||
RewriteRule ^([^./]+)/?$ $1.html [QSA]
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {sveltekit} from "@sveltejs/kit/vite"
|
|||||||
import {defineConfig} from "vite"
|
import {defineConfig} from "vite"
|
||||||
import {SvelteKitPWA} from "@vite-pwa/sveltekit"
|
import {SvelteKitPWA} from "@vite-pwa/sveltekit"
|
||||||
// noinspection ES6PreferShortImport
|
// noinspection ES6PreferShortImport
|
||||||
// import {themeColor} from "./src/lib/style/theme.server.js"
|
import {themeColor} from "./src/lib/style/theme.server.js"
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
@@ -10,13 +10,13 @@ export default defineConfig({
|
|||||||
SvelteKitPWA({
|
SvelteKitPWA({
|
||||||
kit: {
|
kit: {
|
||||||
adapterFallback: "/200.html",
|
adapterFallback: "/200.html",
|
||||||
trailingSlash: "never",
|
trailingSlash: "always",
|
||||||
},
|
},
|
||||||
includeAssets: ["favicon.png"],
|
includeAssets: ["favicon.png"],
|
||||||
manifest: {
|
manifest: {
|
||||||
name: "dot i/o",
|
name: "dot i/o",
|
||||||
id: "dot_io_v2",
|
id: "dot_io_v2",
|
||||||
// theme_color: themeColor,
|
theme_color: themeColor,
|
||||||
icons: [
|
icons: [
|
||||||
{
|
{
|
||||||
src: "icon.svg",
|
src: "icon.svg",
|
||||||
|
|||||||
Reference in New Issue
Block a user