removing need for external internet assets and self hosting our own fonts

This commit is contained in:
Martin McKeaveney 2023-06-14 14:54:27 +01:00
parent bf566ab031
commit cd1675098f
10 changed files with 34 additions and 29 deletions

View File

@ -5,9 +5,10 @@
<meta charset='utf8'>
<meta name='viewport' content='width=device-width'>
<title>Budibase</title>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
rel="stylesheet" />
<link href="/fonts/source-sans-pro/400.css" rel="stylesheet" />
<link href="/fonts/source-sans-pro/600.css" rel="stylesheet" />
<link href="/fonts/source-sans-pro/700.css" rel="stylesheet" />
<link href="/fonts/remixicon.css" rel="stylesheet" />
</head>
<body id="app">

View File

@ -70,6 +70,7 @@
"@codemirror/state": "^6.2.0",
"@codemirror/theme-one-dark": "^6.1.2",
"@codemirror/view": "^6.11.2",
"@fontsource/source-sans-pro": "^5.0.3",
"@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-brands-svg-icons": "^6.2.1",
"@fortawesome/free-solid-svg-icons": "^6.2.1",
@ -122,6 +123,7 @@
"tsconfig-paths": "4.0.0",
"typescript": "4.7.3",
"vite": "^3.0.8",
"vite-plugin-static-copy": "^0.16.0",
"vitest": "^0.29.2"
},
"nx": {

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -8,7 +8,7 @@
$: platformTitle =
!$auth.user && platformTitleText ? platformTitleText : "Budibase"
$: faviconUrl = $organisation.faviconUrl || "https://i.imgur.com/Xhdt1YP.png"
$: faviconUrl = $organisation.faviconUrl || "/builder/bblogoimgur.png"
onMount(async () => {
await organisation.init()
@ -27,6 +27,6 @@
<link rel="icon" href={faviconUrl} />
{:else}
<!-- A default must be set or the browser defaults to favicon.ico behaviour -->
<link rel="icon" href={"https://i.imgur.com/Xhdt1YP.png"} />
<link rel="icon" href={"/builder/bblogoimgur.png"} />
{/if}
</svelte:head>

View File

@ -44,7 +44,7 @@
<div tabindex="-1" class="exampleApp">
<div class="page">
<div class="header">
<img alt="Budibase Logo" src={"https://i.imgur.com/Xhdt1YP.png"} />
<img alt="Budibase Logo" src={"/builder/bblogoimgur.png"} />
<h1>{name}</h1>
</div>
<div class="nav">Home</div>

View File

@ -1,6 +1,7 @@
import { svelte } from "@sveltejs/vite-plugin-svelte"
import replace from "@rollup/plugin-replace"
import { defineConfig, loadEnv } from "vite"
import { viteStaticCopy } from "vite-plugin-static-copy"
import path from "path"
const ignoredWarnings = [
@ -59,6 +60,18 @@ export default defineConfig(({ mode }) => {
),
"process.env.SENTRY_DSN": JSON.stringify(process.env.SENTRY_DSN),
}),
viteStaticCopy({
targets: [
{
src: "../../node_modules/@fontsource/source-sans-pro",
dest: "fonts"
},
{
src: "../../node_modules/remixicon/fonts/*",
dest: "fonts",
}
]
})
],
optimizeDeps: {
exclude: ["@roxi/routify"],

View File

@ -181,7 +181,7 @@
<div class="logo">
{#if !hideLogo}
<img
src={logoUrl || "https://i.imgur.com/Xhdt1YP.png"}
src={logoUrl || "/builder/bblogoimgur.png"}
alt={title}
/>
{/if}

View File

@ -18,7 +18,7 @@
<img
class="logo"
alt="logo"
src={logoUrl || "https://i.imgur.com/Xhdt1YP.png"}
src={logoUrl || "/builder/bblogoimgur.png"}
height="48"
/>
</a>

View File

@ -40,19 +40,14 @@
{#if favicon !== ""}
<link rel="icon" type="image/png" href={favicon} />
{:else}
<link rel="icon" type="image/png" href="https://i.imgur.com/Xhdt1YP.png" />
<link rel="icon" type="image/png" href="/builder/bblogoimgur.png" />
{/if}
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
rel="stylesheet"
/>
<link
href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css"
rel="stylesheet"
/>
<link href="/fonts/source-sans-pro/400.css" rel="stylesheet" />
<link href="/fonts/source-sans-pro/600.css" rel="stylesheet" />
<link href="/fonts/source-sans-pro/700.css" rel="stylesheet" />
<link href="/fonts/remixicon.css" rel="stylesheet" />
<style>
html,
body {

View File

@ -1,16 +1,10 @@
<html lang="en">
<head>
<title>Budibase Builder Preview</title>
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap"
rel="stylesheet"
/>
<link
href="https://cdn.jsdelivr.net/npm/remixicon@2.5.0/fonts/remixicon.css"
rel="stylesheet"
/>
<link href="/builder/fonts/source-sans-pro/400.css" rel="stylesheet" />
<link href="/builder/fonts/source-sans-pro/600.css" rel="stylesheet" />
<link href="/builder/fonts/source-sans-pro/700.css" rel="stylesheet" />
<link href="/builder/fonts/remixicon.css" rel="stylesheet" />
<style>
html, body {
padding: 0;