From 7c98fb551e1d8621186028aa03b3f184481b6229 Mon Sep 17 00:00:00 2001
From: Frank Showalter <842058+fshowalter@users.noreply.github.com>
Date: Tue, 30 Jul 2024 19:58:33 -0400
Subject: [PATCH 2/3] search assets
---
astro.config.js | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/astro.config.js b/astro.config.js
index 01645acec..8192ba367 100644
--- a/astro.config.js
+++ b/astro.config.js
@@ -28,11 +28,18 @@ function contentHmr() {
function pagefind() {
let outDir;
+ let assets;
return {
name: "pagefind",
hooks: {
"astro:config:setup": ({ config }) => {
outDir = fileURLToPath(config.outDir);
+
+ if (config.build.assetsPrefix) {
+ assets = null;
+ } else {
+ assets = config.build.assets;
+ }
},
"astro:server:setup": ({ server, logger }) => {
if (!outDir) {
@@ -46,7 +53,10 @@ function pagefind() {
etag: true,
});
server.middlewares.use((req, res, next) => {
- if (req.url?.startsWith("/pagefind/")) {
+ if (
+ req.url?.startsWith("/pagefind/") ||
+ (assets && req.url?.startsWith(`/${assets}/`))
+ ) {
serve(req, res, next);
} else {
next();
From 9f45bef5fa0c992f80680fb88922735330e0ad61 Mon Sep 17 00:00:00 2001
From: Frank Showalter <842058+fshowalter@users.noreply.github.com>
Date: Tue, 30 Jul 2024 20:00:00 -0400
Subject: [PATCH 3/3] search styles
---
src/layouts/Layout.astro | 2 +-
src/pages/__snapshots__/404.html | 2 +-
src/pages/__snapshots__/gone.html | 2 +-
src/pages/__snapshots__/how-i-grade.html | 2 +-
src/pages/__snapshots__/index.html | 2 +-
src/pages/readings/stats/__snapshots__/2022.html | 2 +-
src/pages/readings/stats/__snapshots__/2023.html | 2 +-
src/pages/readings/stats/__snapshots__/2024.html | 2 +-
src/pages/readings/stats/__snapshots__/index.html | 2 +-
.../about-face-by-david-h-hackworth-julie-sherman.html | 2 +-
src/pages/reviews/__snapshots__/altar-by-philip-fracassi.html | 2 +-
.../__snapshots__/behold-the-void-by-philip-fracassi.html | 2 +-
.../__snapshots__/brother-iron-sister-steel-by-dave-draper.html | 2 +-
.../reviews/__snapshots__/cant-hurt-me-by-david-goggins.html | 2 +-
src/pages/reviews/__snapshots__/carrie-by-stephen-king.html | 2 +-
.../reviews/__snapshots__/casino-royale-by-ian-fleming.html | 2 +-
.../reviews/__snapshots__/churchill-by-andrew-roberts.html | 2 +-
src/pages/reviews/__snapshots__/coffin-by-philip-fracassi.html | 2 +-
.../reviews/__snapshots__/consider-this-by-chuck-palahniuk.html | 2 +-
src/pages/reviews/__snapshots__/cured-by-lol-tolhurst.html | 2 +-
.../reviews/__snapshots__/desert-pickup-by-richard-laymon.html | 2 +-
.../reviews/__snapshots__/doctor-sleep-by-stephen-king.html | 2 +-
.../dont-let-them-get-you-down-by-philip-fracassi.html | 2 +-
src/pages/reviews/__snapshots__/dracula-by-bram-stoker.html | 2 +-
src/pages/reviews/__snapshots__/draft-no-4-by-john-mcphee.html | 2 +-
.../extreme-ownership-by-jocko-willink-leif-babin.html | 2 +-
.../reviews/__snapshots__/fail-safe-by-philip-fracassi.html | 2 +-
.../reviews/__snapshots__/fast-forward-by-stephen-morris.html | 2 +-
.../reviews/__snapshots__/fight-club-by-chuck-palahniuk.html | 2 +-
.../__snapshots__/fright-night-by-john-skipp-craig-spector.html | 2 +-
.../fright-night-origins-by-tom-holland-a-jack-ulrich.html | 2 +-
src/pages/reviews/__snapshots__/gothic-by-philip-fracassi.html | 2 +-
.../reviews/__snapshots__/hawk-mountain-by-conner-habib.html | 2 +-
.../reviews/__snapshots__/i-will-find-you-by-joe-kenda.html | 2 +-
.../__snapshots__/is-this-anything-by-jerry-seinfeld.html | 2 +-
.../__snapshots__/less-than-zero-by-bret-easton-ellis.html | 2 +-
.../reviews/__snapshots__/live-and-let-die-by-ian-fleming.html | 2 +-
.../__snapshots__/living-with-a-seal-by-jesse-itzler.html | 2 +-
src/pages/reviews/__snapshots__/mandala-by-philip-fracassi.html | 2 +-
src/pages/reviews/__snapshots__/moonraker-by-ian-fleming.html | 2 +-
src/pages/reviews/__snapshots__/mother-by-philip-fracassi.html | 2 +-
src/pages/reviews/__snapshots__/on-writing-by-stephen-king.html | 2 +-
.../__snapshots__/out-are-the-lights-by-richard-laymon.html | 2 +-
.../__snapshots__/record-play-pause-by-stephen-morris.html | 2 +-
.../__snapshots__/roadside-pickup-by-richard-laymon.html | 2 +-
.../reviews/__snapshots__/sacculina-by-philip-fracassi.html | 2 +-
src/pages/reviews/__snapshots__/salems-lot-by-stephen-king.html | 2 +-
.../reviews/__snapshots__/set-the-boy-free-by-johnny-marr.html | 2 +-
.../soft-construction-of-a-sunset-by-philip-fracassi.html | 2 +-
.../reviews/__snapshots__/surfer-girl-by-philip-fracassi.html | 2 +-
.../__snapshots__/the-48-laws-of-power-by-robert-greene.html | 2 +-
.../__snapshots__/the-baby-farmer-by-philip-fracassi.html | 2 +-
.../__snapshots__/the-big-sleep-by-raymond-chandler.html | 2 +-
.../reviews/__snapshots__/the-cellar-by-richard-laymon.html | 2 +-
src/pages/reviews/__snapshots__/the-cipher-by-kathe-koja.html | 2 +-
.../reviews/__snapshots__/the-creative-act-by-rick-rubin.html | 2 +-
.../__snapshots__/the-dark-tunnel-by-ross-macdonald.html | 2 +-
.../__snapshots__/the-horse-thief-by-philip-fracassi.html | 2 +-
.../__snapshots__/the-max-muscle-plan-by-brad-schoenfeld.html | 2 +-
.../the-postman-always-rings-twice-by-james-m-cain.html | 2 +-
.../the-rise-of-theodore-roosevelt-by-edmund-morris.html | 2 +-
.../the-rules-of-attraction-by-bret-easton-ellis.html | 2 +-
.../__snapshots__/the-secret-history-by-donna-tartt.html | 2 +-
.../reviews/__snapshots__/the-shining-by-stephen-king.html | 2 +-
.../the-skeptics-guide-to-the-universe-by-steven-novella.html | 2 +-
.../__snapshots__/the-woods-are-dark-by-richard-laymon.html | 2 +-
.../__snapshots__/total-recall-by-arnold-schwarzenegger.html | 2 +-
.../__snapshots__/what-doesnt-kill-us-by-scott-carney.html | 2 +-
68 files changed, 68 insertions(+), 68 deletions(-)
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro
index e5169c06f..7de38d842 100644
--- a/src/layouts/Layout.astro
+++ b/src/layouts/Layout.astro
@@ -55,7 +55,7 @@ const pathname = new URL(Astro.request.url).pathname;