Implement pagefind

This commit is contained in:
Kaan Barmore-Genç 2024-05-09 22:33:58 -05:00
parent f5a1c6de5a
commit ce47707134
Signed by: kaan
GPG key ID: B2E280771CD62FCF
16 changed files with 129 additions and 72 deletions

76
package-lock.json generated
View file

@ -9,6 +9,7 @@
"version": "0.0.1",
"dependencies": {
"@sveltejs/adapter-static": "^2.0.3",
"pagefind": "^1.1.0",
"reading-time-estimator": "^1.11.0"
},
"devDependencies": {
@ -240,6 +241,66 @@
"node": ">= 8"
}
},
"node_modules/@pagefind/darwin-arm64": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@pagefind/darwin-arm64/-/darwin-arm64-1.1.0.tgz",
"integrity": "sha512-SLsXNLtSilGZjvqis8sX42fBWsWAVkcDh1oerxwqbac84HbiwxpxOC2jm8hRwcR0Z55HPZPWO77XeRix/8GwTg==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@pagefind/darwin-x64": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@pagefind/darwin-x64/-/darwin-x64-1.1.0.tgz",
"integrity": "sha512-QjQSE/L5oS1C8N8GdljGaWtjCBMgMtfrPAoiCmINTu9Y9dp0ggAyXvF8K7Qg3VyIMYJ6v8vg2PN7Z3b+AaAqUA==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"darwin"
]
},
"node_modules/@pagefind/linux-arm64": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@pagefind/linux-arm64/-/linux-arm64-1.1.0.tgz",
"integrity": "sha512-8zjYCa2BtNEL7KnXtysPtBELCyv5DSQ4yHeK/nsEq6w4ToAMTBl0K06khqxdSGgjMSwwrxvLzq3so0LC5Q14dA==",
"cpu": [
"arm64"
],
"optional": true,
"os": [
"linux"
]
},
"node_modules/@pagefind/linux-x64": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@pagefind/linux-x64/-/linux-x64-1.1.0.tgz",
"integrity": "sha512-4lsg6VB7A6PWTwaP8oSmXV4O9H0IHX7AlwTDcfyT+YJo/sPXOVjqycD5cdBgqNLfUk8B9bkWcTDCRmJbHrKeCw==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"linux"
]
},
"node_modules/@pagefind/windows-x64": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.1.0.tgz",
"integrity": "sha512-OboCM76BcMKT9IoSfZuFhiqMRgTde8x4qDDvKulFmycgiJrlL5WnIqBHJLQxZq+o2KyZpoHF97iwsGAm8c32sQ==",
"cpu": [
"x64"
],
"optional": true,
"os": [
"win32"
]
},
"node_modules/@polka/url": {
"version": "1.0.0-next.23",
"license": "MIT"
@ -2010,6 +2071,21 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/pagefind": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/pagefind/-/pagefind-1.1.0.tgz",
"integrity": "sha512-1nmj0/vfYcMxNEQj0YDRp6bTVv9hI7HLdPhK/vBBYlrnwjATndQvHyicj5Y7pUHrpCFZpFnLVQXIF829tpFmaw==",
"bin": {
"pagefind": "lib/runner/bin.cjs"
},
"optionalDependencies": {
"@pagefind/darwin-arm64": "1.1.0",
"@pagefind/darwin-x64": "1.1.0",
"@pagefind/linux-arm64": "1.1.0",
"@pagefind/linux-x64": "1.1.0",
"@pagefind/windows-x64": "1.1.0"
}
},
"node_modules/parent-module": {
"version": "1.0.1",
"dev": true,

View file

@ -4,12 +4,14 @@
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"build": "vite build && npm run build:pagefind",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
"format": "prettier --write .",
"pagefind": "pagefind",
"build:pagefind": "pagefind --site .svelte-kit/output/prerendered/pages/"
},
"devDependencies": {
"@sveltejs/kit": "^1.27.6",
@ -37,6 +39,7 @@
"type": "module",
"dependencies": {
"@sveltejs/adapter-static": "^2.0.3",
"pagefind": "^1.1.0",
"reading-time-estimator": "^1.11.0"
}
}

View file

@ -5,3 +5,5 @@ $size-modal: 480px;
$min-w-supported: 370px;
$size-full-w: max(100vw, $min-w-supported);
$border: 3px solid $color-accent;

View file

@ -8,5 +8,12 @@
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
<link href="/pagefind/pagefind-ui.css" rel="stylesheet" />
<script src="/pagefind/pagefind-ui.js"></script>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
new PagefindUI({ element: '#search', showSubResults: true });
});
</script>
</body>
</html>

View file

@ -103,3 +103,20 @@ body {
min-height: 100vh;
flex-direction: column;
}
/* Pagefind UI */
.pagefind-ui {
--pagefind-ui-border-radius: 0;
--pagefind-ui-image-border-radius: 0;
--pagefind-ui-font: inherit;
.pagefind-ui__drawer {
position: absolute;
z-index: var(--z-index-modal);
background-color: var(--color-bg);
box-shadow: var(--shadow-medium);
padding: 2rem;
border: $border;
border-top: 0;
}
}

View file

@ -1,10 +1,16 @@
<script>
import Button from '$lib/Button.svelte';
import Spacer from '$lib/Spacer.svelte';
import { onMount } from 'svelte';
import Avif from './logo.avif';
import Jpeg from './logo.avif?format=jpeg';
import WebP from './logo.avif?format=webp';
onMount(() => {
// @ts-ignore
new PagefindUI({ element: '#search', showSubResults: true });
});
</script>
<header>
@ -20,6 +26,7 @@
</picture>
</a>
<Spacer />
<div id="search"></div>
<Button href="/posts/">Blog</Button>
<Button href="/portfolio/">Portfolio</Button>
</header>
@ -49,4 +56,7 @@
min-width: 6rem;
min-height: 3rem;
}
#search {
min-width: 1rem;
}
</style>

BIN
static/android-chrome-192x192.png (Stored with Git LFS)

Binary file not shown.

BIN
static/android-chrome-512x512.png (Stored with Git LFS)

Binary file not shown.

BIN
static/apple-touch-icon.png (Stored with Git LFS)

Binary file not shown.

BIN
static/extra/Crafty Poster.pdf (Stored with Git LFS)

Binary file not shown.

BIN
static/extra/DepAware Poster.pdf (Stored with Git LFS)

Binary file not shown.

View file

@ -1,52 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGLIy/wBEADIJv4lLqYooKxO/JGNfJlg75aT9Klv8upT4j5GgOy8NXQyg9HY
J3r7N2YFBmoiWjgm2MBV1kO43jJae5HWWw5fHY3G2n1j3b1Lj9g8AOIdyMbLQwXC
RW1bfCRBxDETBeNjLcu20QU9FEPifyxesbXucJiFpEn/SwuT6sb316vp7txt5FlY
XjHLUyiON40LMG1Wv90VIy+MNuLMzKELZFaPdSFZ0xw+ZStfIgMNmhnBROQoP6RB
4eWWPaVF6GskR+w/Aaz9o+kOWVPTYalAUxLUpTeOr6hwO6aJ74YTs9cQQwWMXZRm
bAlwmNjK4XcmU4ak1OG2h7a+NUdYHKqw9/LLm3bFIqYhygpUOv9KBawMT/Alunym
Ak1yo2eR+Nf8qp2j0WobAJfFFRiQI9d78oHaEe8lMKND6b189+uIj/A9VZECj8ma
1h80ewyxY2mY2z/K3jTAX0HL6LIt9WHSJQGV6pVlQkZZJfkcCrHCePsjAmCeRCca
wXm0I9HuKkDHiogOXMJ6WDi644cyAEy8KmKb9NlinnXW53rOIekQ6u6TZrjS/cD2
i7C3WnVwIAYWMwJ7RzbkyKhUuIX0zcnKuLa8YGKUU98CApqbsmFoyWxjfROEW3MZ
OrMPAAP/FfdUhkdIjH2Jp6B2kJyL/vrurkQ/SktvcYGa7yVskmEgtVvlSQARAQAB
tC9LYWFuIEdlbmMgKEthYW4gQmFybW9yZS1HZW7DpykgPGthYW5AYmdlbmMubmV0
PokCTgQTAQgAOBYhBPXexSaKpQHzX71ZeLLigHcc1i/PBQJiyMv8AhsDBQsJCAcC
BhUKCQgLAgQWAgMBAh4BAheAAAoJELLigHcc1i/PcPwQAIuFesWu+xHeft2duYta
J/tGSdnats9k0nro/0zr2tpsT4AKT/SY1Nv/yECPRrG5jYVM6m6XEb52ZTNgM5H6
T730Dgy7Bcxe7HsqQ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u0H67DEOzksZdH
710Cvsll37K7JqlHL3SQsYyl82m0g2pJQWVBbc+P3bw4SDVdGoGjo6eJq4KdSRtX
MqsmcRDhlhP4elb61I/+Gg6CAUxXHrqfEArQczZ1qpbWVe3soVE1WYYuNuZwUvt4
w3xQOj84HgiGn+unUC1ARgBFim382N8dBHWzYHXQwDFhpzAZv+zEgcTmg2d+kVfz
3gb3OMGGz/ydLWEGfQARAQABiQI2BBgBCAAgFiEE9d7FJoqlAfNfvVl4suKAdxzW
L88FAmLIy/wCGwwACgkQsuKAdxzWL8+bEA//a0+qEztxg4Yu15KqjtABwe1r8+u1
uRlVqmbSZdpdhbDA6cb++PeQKy1r6MABKeMyDP6aKXykGfGNjY/bQWwkqiUdUjRj
pM0MAD4awOgiVDjvVdc8crqncwAzP90KwcFx16GTk4B0JokWw2bxrPeaQuRqj+EP
pIZMFU201pWynT491Gl8mKPuSoJHgUjDX6pemk9QYTrji78VNVYnj1DaXBNULp4x
TlCp9s50VuyVCgYyJm8r1QL8579aKXvF2lw/7bNwH2xqXNAerXCa7tuKl4s3tQds
bfn/xI4PHFkYS9H+XfcWTH1bwi3mdsnNdNHO2Qlek4ak2jba+ngC4EVETvHyUsNM
+JIOttNUxX+/EvnKlhkBttyNomdoGf9E1GowNLVUXpqOurJY9gJDwE2P2z6FJgRR
DPmK5u4SDnw67u+XdiWZZlvoNgY+ihtl1/4u9+9WEDI+XeMuD/qnXqbObNtVLLOu
Bvlq8sFqC/WL5B80E3xEBK7GjVlGnXCdhmGxt5hVC5ZPuKwzfU8zCeW65hACA+f5
eRzAtlfEVxxTRdlUZhjlkIxQdUGFKEax0lnEC7RNNNz4V02Udv/AexVBh8KMhdwi
18kzFejzCGurVuOzOFAtWjf+cOVbOb63Gk9UGMgnZLTPRLMeHmEi/FmdBJw5+IQF
2Vw6bCeYRslIgNo=
=tme2
-----END PGP PUBLIC KEY BLOCK-----

BIN
static/favicon-16x16.png (Stored with Git LFS)

Binary file not shown.

BIN
static/favicon-32x32.png (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

BIN
static/favicon.png (Stored with Git LFS)

Binary file not shown.