WE'LL DO IT LIVE

This commit is contained in:
Jon Staab
2024-10-23 08:55:40 -07:00
parent dd032dd428
commit f0d53ebb39
4 changed files with 30 additions and 16 deletions

View File

@@ -21,3 +21,9 @@ fi
npx pwa-assets-generator npx pwa-assets-generator
npx vite build npx vite build
# Replace index.html variables with stuff from our env
perl -i -pe"s|{DESCRIPTION}|$VITE_PLATFORM_DESCRIPTION|g" build/index.html
perl -i -pe"s|{ACCENT}|$VITE_PLATFORM_ACCENT|g" build/index.html
perl -i -pe"s|{NAME}|$VITE_PLATFORM_NAME|g" build/index.html
perl -i -pe"s|{URL}|$VITE_PLATFORM_URL|g" build/index.html

View File

@@ -3,6 +3,26 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="{ACCENT}" />
<meta name="description" content="{DESCRIPTION}" />
<meta name="og:url" content="{URL}" />
<meta name="og:type" content="website" />
<meta name="og:title" content="{NAME}" />
<meta name="og:description" content="{DESCRIPTION}" />
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="{URL}" />
<meta name="twitter:title" content="{NAME}" />
<meta name="twitter:description" content="{DESCRIPTION}" />
<meta name="twitter:image" content="/maskable-icon-512x512.png" />
<link rel="manifest" href="/manifest.webmanifest" />
<link rel="icon" href="/favicon.ico" sizes="48x48" />
<link rel="icon" href="/pwa-64x64.ico" sizes="any" type="image/png" />
<link rel="icon" href="/pwa-192x192.ico" sizes="any" type="image/png" />
<link rel="icon" href="/pwa-512x512.ico" sizes="any" type="image/png" />
<link rel="icon" href="/pwa-64x64.ico" sizes="64x64" type="image/png" />
<link rel="icon" href="/pwa-192x192.ico" sizes="192x192" type="image/png" />
<link rel="icon" href="/pwa-512x512.ico" sizes="512x512" type="image/png" />
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon-180x180.png" />
%sveltekit.head% %sveltekit.head%
</head> </head>
<body data-sveltekit-preload-data="hover"> <body data-sveltekit-preload-data="hover">

View File

@@ -1,6 +1,5 @@
<script lang="ts"> <script lang="ts">
import "@src/app.css" import "@src/app.css"
import {pwaInfo} from 'virtual:pwa-info';
import {onMount} from "svelte" import {onMount} from "svelte"
import {get} from "svelte/store" import {get} from "svelte/store"
import {sleep, take, sortBy, ago, now, HOUR} from "@welshman/lib" import {sleep, take, sortBy, ago, now, HOUR} from "@welshman/lib"
@@ -142,12 +141,6 @@
}) })
</script> </script>
<svelte:head>
<meta name="theme-color" content={PLATFORM_ACCENT} />
<link rel="icon" href={PLATFORM_LOGO} />
<link rel="manifest" href="/manifest.webmanifest" />
</svelte:head>
{#await ready} {#await ready}
<div data-theme={$theme} /> <div data-theme={$theme} />
{:then} {:then}

View File

@@ -9,11 +9,6 @@ import svg from "@poppanator/sveltekit-svg"
dotenv.config({path: ".env.local"}) dotenv.config({path: ".env.local"})
dotenv.config({path: ".env"}) dotenv.config({path: ".env"})
const FAVICONS_DIR = "static/favicons"
const name = process.env.VITE_PLATFORM_NAME
const accent = process.env.VITE_PLATFORM_ACCENT
const description = process.env.VITE_PLATFORM_DESCRIPTION
export default defineConfig({ export default defineConfig({
server: { server: {
port: 1847, port: 1847,
@@ -30,10 +25,10 @@ export default defineConfig({
maximumFileSizeToCacheInBytes: 5 * 1024 ** 2, // 5 MB or set to something else maximumFileSizeToCacheInBytes: 5 * 1024 ** 2, // 5 MB or set to something else
}, },
manifest: { manifest: {
name: name, name: process.env.VITE_PLATFORM_NAME,
short_name: name, short_name: process.env.VITE_PLATFORM_NAME,
theme_color: accent, theme_color: process.env.VITE_PLATFORM_ACCENT,
description: description, description: process.env.VITE_PLATFORM_DESCRIPTION,
permissions: ["clipboardRead", "clipboardWrite", "unlimitedStorage"], permissions: ["clipboardRead", "clipboardWrite", "unlimitedStorage"],
icons: [ icons: [
{src: "pwa-64x64.png", sizes: "64x64", type: "image/png"}, {src: "pwa-64x64.png", sizes: "64x64", type: "image/png"},