Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ vite.config.ts.timestamp-*
# Local Netlify folder
.netlify
/static/pagefind
/static/~partytown
.env
1 change: 1 addition & 0 deletions .vscode/ltex.dictionary.en-US.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,4 @@ Roboto
Saira
impersonification
Partiful
Partytown
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ pnpm run dev
# Open http://localhost:37572
```

## Debugging

The website uses the Partytown library, which can clutter network requests in DevTools with entries for `proxytown`. To exclude those requests, you can use the filter `-url:proxytown`.

## Deployment

The contents of the repository are continuously deployed to Netlify. You can track the deployment status [here](https://app.netlify.com/sites/pauseai/deploys).
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"vite": "^5.2.2"
},
"dependencies": {
"@builder.io/partytown": "^0.10.2",
"@fontsource/jetbrains-mono": "^4.5.12",
"@fontsource/manrope": "^4.5.13",
"@fontsource/roboto-slab": "^5.0.19",
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/exclude-from-edge-function.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { promises as fs } from 'fs'

const MANIFEST_PATH = '.netlify/edge-functions/manifest.json'
const EXCLUDE_PATHS = ['^/pagefind/.*$']
const EXCLUDE_PATHS = ['^/pagefind/.*$', '^/~partytown/.*$']

const manifest = JSON.parse(await fs.readFile(MANIFEST_PATH, 'utf-8'))
const renderFunction = manifest.functions.find(
Expand Down
72 changes: 37 additions & 35 deletions src/app.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<link rel="alternate" type="application/atom+xml" href="/rss.xml" />

<script type="module">
const theme = localStorage.getItem('color-scheme')

theme
? document.documentElement.setAttribute('color-scheme', theme)
: localStorage.setItem('color-scheme', 'dark')
</script>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VRJ4J53FC8"></script>
<script>
window.dataLayer ??= []
function gtag() {
dataLayer.push(arguments)
}

gtag('js', new Date())
gtag('config', 'G-VRJ4J53FC8')
gtag('config', 'AW-16494962941')
</script>

%sveltekit.head%
</head>

<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<link rel="alternate" type="application/atom+xml" href="/rss.xml" />

<script type="module">
const theme = localStorage.getItem('color-scheme')

theme
? document.documentElement.setAttribute('color-scheme', theme)
: localStorage.setItem('color-scheme', 'dark')
</script>

<!-- Google tag (gtag.js) -->
<script
type="text/partytown"
async
src="https://www.googletagmanager.com/gtag/js?id=G-VRJ4J53FC8"
></script>
<script type="text/partytown">
window.dataLayer ??= []
window.gtag = function() {
dataLayer.push(arguments)
}

gtag('js', new Date())
gtag('config', 'G-VRJ4J53FC8')
gtag('config', 'AW-16494962941')
</script>

%sveltekit.head%
</head>

<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
10 changes: 10 additions & 0 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { Toaster } from 'svelte-french-toast'
import { ProgressBar } from '@prgm/sveltekit-progress-bar'
import { partytownSnippet } from '@builder.io/partytown/integration'

import Footer from './footer.svelte'
import Header from './header.svelte'
Expand All @@ -16,6 +17,15 @@
export let data
</script>

<svelte:head>
<script>
partytown = {
forward: ['dataLayer.push', 'gtag']
}
</script>
{@html '<script>' + partytownSnippet() + '</script>'}
</svelte:head>

<h2 style="width: 0; height: 0; margin: 0; padding: 0; visibility: hidden;" data-pagefind-ignore>
(Top)
</h2>
Expand Down
11 changes: 10 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
import { partytownVite } from '@builder.io/partytown/utils'
import { join } from 'path'
import { sveltekit } from '@sveltejs/kit/vite'

const config = {
server: {
port: 37572
},
plugins: [sveltekit()]
plugins: [
// Partytown first because SvelteKit copies /static in same hook
partytownVite({
// Place in /static as /build is wiped by adapter which always runs last
dest: join(__dirname, 'static', '~partytown')
}),
sveltekit()
]
}

export default config