Skip to content

Commit 5b080f5

Browse files
committed
fix: update site/base config for blog-stage.python.org custom domain
1 parent c54c5cb commit 5b080f5

File tree

1 file changed

+4
-13
lines changed

1 file changed

+4
-13
lines changed

astro.config.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,16 @@ import remarkPythonRefs from "./src/plugins/remark-python-refs";
99
const isDev = process.env.NODE_ENV === "development" || process.argv.includes("dev");
1010

1111
// Load redirects generated by the migration script
12-
// Astro prepends `base` to the redirect source but not the target,
13-
// so we prepend it ourselves for non-root deployments.
14-
const base = isDev ? "" : "/python-insider-blog";
1512
let redirects: Record<string, string> = {};
1613
try {
1714
const redirectsPath = new URL("./src/data/redirects.json", import.meta.url);
18-
const raw: Record<string, string> = JSON.parse(fs.readFileSync(redirectsPath, "utf-8"));
19-
for (const [from, to] of Object.entries(raw)) {
20-
redirects[from] = `${base}${to}`;
21-
}
15+
redirects = JSON.parse(fs.readFileSync(redirectsPath, "utf-8"));
2216
} catch {
2317
// No redirects file yet (run migration first)
2418
}
2519

2620
// Blogger feed URL → new RSS feed
27-
redirects["/feeds/posts/default"] = `${base}/rss.xml`;
21+
redirects["/feeds/posts/default"] = "/rss.xml";
2822

2923
// Keystatic integration only in dev mode (requires server rendering)
3024
const integrations = [mdx(), sitemap(), react()];
@@ -33,12 +27,9 @@ if (isDev) {
3327
integrations.push(keystatic());
3428
}
3529

36-
// When moving to blog.python.org, change site and remove base:
37-
// site: "https://blog.python.org",
38-
// base: "/",
3930
export default defineConfig({
40-
site: "https://jacobcoffee.github.io",
41-
base: isDev ? "/" : "/python-insider-blog",
31+
site: "https://blog-stage.python.org",
32+
base: "/",
4233
integrations,
4334
output: isDev ? "server" : "static",
4435
...(isDev && {

0 commit comments

Comments
 (0)