Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
42 changes: 38 additions & 4 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
{
"hosting": {
"public": "public",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
"headers": [
{
"source": "**/*.html",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=0, must-revalidate"
}
]
},
{
"source": "page-data/**",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=0, must-revalidate"
}
]
},
{
"source": "static/**",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
},
{
"source": "**/*.@(js|css)",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
}
]
}
}
12 changes: 6 additions & 6 deletions gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// custom typefaces
import "@fontsource/inter/400.css"
import "@fontsource/inter/500.css"
import "@fontsource/inter/700.css"
import "@fontsource/jetbrains-mono/400.css"
import "@fontsource/jetbrains-mono/500.css"
import "@fontsource/jetbrains-mono/700.css"
import "@fontsource/inter/latin-400.css"
import "@fontsource/inter/latin-500.css"
import "@fontsource/inter/latin-700.css"
import "@fontsource/jetbrains-mono/latin-400.css"
import "@fontsource/jetbrains-mono/latin-500.css"
import "@fontsource/jetbrains-mono/latin-700.css"

// custom CSS styles
import "./src/style.css"
Expand Down
20 changes: 20 additions & 0 deletions gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,23 @@ exports.onRenderBody = ({ setHeadComponents }) => {
/>,
])
}

// Gatsby inlines the full stylesheet into every page's <head>. Link the
// cacheable styles.<hash>.css instead so each page doesn't re-ship it.
exports.onPreRenderHTML = ({ getHeadComponents, replaceHeadComponents }) => {
if (process.env.NODE_ENV !== "production") return

replaceHeadComponents(
getHeadComponents().map(el =>
el.type === "style" && el.props["data-href"] ? (
<link
rel="stylesheet"
key={el.props["data-href"]}
href={el.props["data-href"]}
/>
) : (
el
),
),
)
}
29 changes: 0 additions & 29 deletions src/pages/404.js

This file was deleted.

22 changes: 22 additions & 0 deletions static/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex">
<title>404: Not Found | happy PHP dev</title>
<style>
body{margin:0;min-height:100vh;display:grid;place-items:center;font-family:system-ui,-apple-system,sans-serif;background:#fff;color:#222;text-align:center;padding:16px;box-sizing:border-box}
h1{font-family:ui-monospace,monospace;margin:0 0 .5em}
a{color:#005b99}
@media (prefers-color-scheme:dark){body{background:#111;color:#ddd}a{color:#6cb6ff}}
</style>
</head>
<body>
<main>
<h1>404: Not Found</h1>
<p>You just hit a route that doesn&#39;t exist... the sadness.</p>
<p><a href="/">Back to the homepage</a></p>
</main>
</body>
</html>
10 changes: 10 additions & 0 deletions static/robots.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
User-agent: *
Disallow:

User-agent: GPTBot
User-agent: CCBot
User-agent: ClaudeBot
User-agent: anthropic-ai
User-agent: Bytespider
User-agent: PerplexityBot
User-agent: Amazonbot
User-agent: meta-externalagent
Disallow: /
Loading