Skip to content

Commit c42dc43

Browse files
authored
Merge pull request #4 from Animated-Java/fix/broken-ssr
🩹 Seems like svelte doesn't like it when I set ssr to false for the whole site.
2 parents e827cbc + 073e377 commit c42dc43

File tree

5 files changed

+45
-31
lines changed

5 files changed

+45
-31
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
cmd: build
2323

2424
- name: Push to Build Branch
25+
if: github.ref == 'refs/heads/main'
2526
uses: s0/git-publish-subdir-action@develop
2627
env:
2728
REPO: self

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@
3939
"type": "module",
4040
"dependencies": {
4141
"svelte-youtube-embed": "^0.3.0"
42-
}
42+
},
43+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
4344
}

src/routes/+layout.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { createKitDocsLoader } from '@svelteness/kit-docs'
22

33
export const prerender = true
4-
export const ssr = false
54

65
export const load = createKitDocsLoader({
76
sidebar: {

src/routes/404/+page.svelte

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,7 @@
11
<script lang="ts">
2-
export const flavorQuotes = [
3-
`Uh oh!`,
4-
`Time to fire up the ol' debugger!`,
5-
`Your item displays are sad 🥺`,
6-
`Skill Issue.`,
7-
`Should'a seen that one comming...`,
8-
`Snaviewavie did an oopsie poopsie x3`,
9-
`We to a little trolling.`,
10-
`execute run execute run execute run execute run say This is fine.`,
11-
`This is why we can't have nice things. :(`,
12-
`Have you tried turning it off and on again?`,
13-
`What if I put my command block next to yours? Haha just kidding... Unless?`,
14-
`If at first you don't succeed, try, try again!`,
15-
// We do a little trolling in binary.
16-
`B:01010111 01100101 00100000 01100100 01101111 00100000 01100001 00100000 01101100 01101001 01110100 01110100 01101100 01100101 00100000 01110100 01110010 01101111 01101100 01101100 01101001 01101110 01100111`,
17-
`I've decided to stop working for today. Try again tomorrow!`,
18-
`Every time you see this error message, a developer vanishes in a puff of binary.`,
19-
`"Flavor Text"? I've never tasted text before...`,
20-
`( ͡° ͜ʖ ͡°) nice 404 page you got there.`,
21-
`Some day you'll learn. But until then, I control the cheese.`,
22-
`Please deposit 5 coins!`,
23-
`Failed to find global 'pandemic'.`,
24-
`I'm sorry, Dave. I'm afraid I can't do that.`,
25-
`<a href="https://xkcd.com/221/"><img src="https://imgs.xkcd.com/comics/random_number.png" alt="https://xkcd.com/221/"/></a>`
26-
]
2+
import { page } from '$app/stores'
273
28-
function getRandomFlavorQuote() {
29-
return flavorQuotes[Math.floor(Math.random() * flavorQuotes.length)]
30-
}
4+
const flavorQuote = $page.data.flavorQuote as string
315
</script>
326

337
<div class="page">
@@ -43,7 +17,7 @@
4317
</p>
4418
</div>
4519
</div>
46-
<q class="quote"><span>{@html getRandomFlavorQuote()}</span></q>
20+
<q class="quote"><span>{@html flavorQuote}</span></q>
4721
</div>
4822
</div>
4923

src/routes/404/+page.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import type { PageLoad } from './$types'
2+
3+
export const ssr = false
4+
5+
const flavorQuotes = [
6+
`Uh oh!`,
7+
`Time to fire up the ol' debugger!`,
8+
`Your item displays are sad 🥺`,
9+
`Skill Issue.`,
10+
`Should'a seen that one comming...`,
11+
`Snaviewavie did an oopsie poopsie x3`,
12+
`We to a little trolling.`,
13+
`execute run execute run execute run execute run say This is fine.`,
14+
`This is why we can't have nice things. :(`,
15+
`Have you tried turning it off and on again?`,
16+
`What if I put my command block next to yours? Haha just kidding... Unless?`,
17+
`If at first you don't succeed, try, try again!`,
18+
// We do a little trolling in binary.
19+
`B:01010111 01100101 00100000 01100100 01101111 00100000 01100001 00100000 01101100 01101001 01110100 01110100 01101100 01100101 00100000 01110100 01110010 01101111 01101100 01101100 01101001 01101110 01100111`,
20+
`I've decided to stop working for today. Try again tomorrow!`,
21+
`Every time you see this error message, a developer vanishes in a puff of binary.`,
22+
`"Flavor Text"? I've never tasted text before...`,
23+
`( ͡° ͜ʖ ͡°) nice 404 page you got there.`,
24+
`Some day you'll learn. But until then, I control the cheese.`,
25+
`Please deposit 5 coins!`,
26+
`Failed to find global 'pandemic'.`,
27+
`I'm sorry, Dave. I'm afraid I can't do that.`,
28+
`<a href="https://xkcd.com/221/"><img src="https://imgs.xkcd.com/comics/random_number.png" alt="https://xkcd.com/221/"/></a>`
29+
]
30+
31+
function getRandomFlavorQuote() {
32+
return flavorQuotes[Math.floor(Math.random() * flavorQuotes.length)]
33+
}
34+
35+
export const load: PageLoad = () => {
36+
return {
37+
flavorQuote: getRandomFlavorQuote()
38+
}
39+
}

0 commit comments

Comments
 (0)