summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/BaseHead.astro7
-rw-r--r--src/components/signature/Downloads.astro2
-rw-r--r--src/content.config.ts2
3 files changed, 8 insertions, 3 deletions
diff --git a/src/components/BaseHead.astro b/src/components/BaseHead.astro
index 41926ad..65e568c 100644
--- a/src/components/BaseHead.astro
+++ b/src/components/BaseHead.astro
@@ -98,9 +98,14 @@ const {
const wb = new Workbox("/sw.js", { type: "module" });
wb.addEventListener("activated", (_event) => {
+ if (!location.pathname.startsWith("/blog/read/")) {
+ return;
+ }
const urlsToCache = [
location.href,
- ...performance.getEntriesByType("resource").map((r) => r.name),
+ location.href + ".md",
+ location.href + ".md.sig",
+ ///...performance.getEntriesByType("resource").map((r) => r.name),
];
wb.messageSW({
type: "CACHE_URLS",
diff --git a/src/components/signature/Downloads.astro b/src/components/signature/Downloads.astro
index ac8215f..3497b37 100644
--- a/src/components/signature/Downloads.astro
+++ b/src/components/signature/Downloads.astro
@@ -9,7 +9,7 @@ interface Props {
const { lang } = Astro.props;
let source = new URL(
- `${Astro.url.href.replace("read/", "").replace(/\/$/, "")}.md`,
+ `${Astro.url.href.replace(/\/$/, "")}.md`,
);
const dir = await gitDir();
diff --git a/src/content.config.ts b/src/content.config.ts
index 821faf5..d3504e5 100644
--- a/src/content.config.ts
+++ b/src/content.config.ts
@@ -5,7 +5,7 @@ import { parse } from "toml";
import { Blog, Entity } from "./lib/collection/schemas.ts";
const blog = defineCollection({
- loader: glob({ base: "./public/blog", pattern: "+([0-9a-z-]).md" }),
+ loader: glob({ base: "./public/blog/read", pattern: "+([0-9a-z-]).md" }),
schema: Blog,
});