mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:01:42 +08:00
refactor: update site URL to be single source of truth (#143)
* wip: astro config to use .ts instead of .mjs * fix: remove invalid prop in astro config * refactor: single source of truth for site url * refactor: make minor updates due to astro.config.ts --------- Co-authored-by: satnaing <satnaingdev@gmail.com>
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
!/public
|
!/public
|
||||||
!/.github
|
!/.github
|
||||||
!tsconfig.json
|
!tsconfig.json
|
||||||
!astro.config.mjs
|
!astro.config.ts
|
||||||
!package.json
|
!package.json
|
||||||
!.prettierrc
|
!.prettierrc
|
||||||
!.eslintrc.js
|
!.eslintrc.js
|
||||||
|
|||||||
@@ -4,10 +4,11 @@ import react from "@astrojs/react";
|
|||||||
import remarkToc from "remark-toc";
|
import remarkToc from "remark-toc";
|
||||||
import remarkCollapse from "remark-collapse";
|
import remarkCollapse from "remark-collapse";
|
||||||
import sitemap from "@astrojs/sitemap";
|
import sitemap from "@astrojs/sitemap";
|
||||||
|
import { SITE } from "./src/config";
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
site: "https://astro-paper.pages.dev/", // replace this with your deployed domain
|
site: SITE.website,
|
||||||
integrations: [
|
integrations: [
|
||||||
tailwind({
|
tailwind({
|
||||||
applyBaseStyles: false,
|
applyBaseStyles: false,
|
||||||
@@ -29,7 +30,6 @@ export default defineConfig({
|
|||||||
theme: "one-dark-pro",
|
theme: "one-dark-pro",
|
||||||
wrap: true,
|
wrap: true,
|
||||||
},
|
},
|
||||||
extendDefaultPlugins: true,
|
|
||||||
},
|
},
|
||||||
vite: {
|
vite: {
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import type { Site, SocialObjects } from "./types";
|
import type { Site, SocialObjects } from "./types";
|
||||||
|
|
||||||
export const SITE: Site = {
|
export const SITE: Site = {
|
||||||
website: "https://astro-paper.pages.dev/",
|
website: "https://astro-paper.pages.dev/", // replace this with your deployed domain
|
||||||
author: "Sat Naing",
|
author: "Sat Naing",
|
||||||
desc: "A minimal, responsive and SEO-friendly Astro blog theme.",
|
desc: "A minimal, responsive and SEO-friendly Astro blog theme.",
|
||||||
title: "AstroPaper",
|
title: "AstroPaper",
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ export function remarkReadingTime() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Step (3) Add the plugin to `astro.config.mjs`
|
Step (3) Add the plugin to `astro.config.ts`
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import { remarkReadingTime } from "./src/utils/remark-reading-time.mjs"; // make sure your relative path is correct
|
import { remarkReadingTime } from "./src/utils/remark-reading-time.mjs"; // make sure your relative path is correct
|
||||||
|
|||||||
@@ -34,17 +34,6 @@ export const SITE = {
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, replace site property of `astro.config.mjs` file with your own deployed domain. _(You can also omit this step if you don't have deployed domain yet or you are still in development mode)_
|
|
||||||
|
|
||||||
```js
|
|
||||||
// file: astro.config.mjs
|
|
||||||
export default defineConfig({
|
|
||||||
site: "https://astro-paper.pages.dev/", // replace this with your deployed domain
|
|
||||||
integrations: [...],
|
|
||||||
...
|
|
||||||
)}
|
|
||||||
```
|
|
||||||
|
|
||||||
Here are SITE configuration options
|
Here are SITE configuration options
|
||||||
|
|
||||||
| Options | Description |
|
| Options | Description |
|
||||||
|
|||||||
Reference in New Issue
Block a user