-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathastro.config.ts
52 lines (47 loc) · 1.2 KB
/
astro.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { defineConfig, passthroughImageService } from "astro/config";
import tailwind from "@astrojs/tailwind";
import sitemap from "@astrojs/sitemap";
import { RemarkLinkRewrite } from "./src/plugins/link-rewrite";
import { RemarkReadingTime } from "./src/plugins/reading-time";
import mdx from "@astrojs/mdx";
const config = {
github: {
SITE_URL: "https://rahmanda.github.io",
BASE_PATH: "/blog",
},
netlify: {
SITE_URL: "https://rahmandawibowo.com",
BASE_PATH: "",
},
};
const buildTarget = (process.env.BUILD_TARGET ??
"netlify") as keyof typeof config;
const { SITE_URL, BASE_PATH } = config[buildTarget];
// https://astro.build/config
export default defineConfig({
site: SITE_URL,
base: BASE_PATH,
image: {
service: passthroughImageService(),
},
markdown: {
shikiConfig: {
theme: "github-light",
},
remarkPlugins: [
[
RemarkLinkRewrite,
{
replacer: (url: string) => {
if (url.startsWith("/blog")) {
return url.replace("/blog", BASE_PATH);
}
return url;
},
},
],
RemarkReadingTime,
],
},
integrations: [tailwind(), mdx(), sitemap()],
});