Skip to content

Commit

Permalink
refactor: update site URL to be single source of truth (#143)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
tanishqmanuja and satnaing committed Oct 9, 2023
1 parent 79d569d commit 9dcc5e1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!/public
!/.github
!tsconfig.json
!astro.config.mjs
!astro.config.ts
!package.json
!.prettierrc
!.eslintrc.js
Expand Down
4 changes: 2 additions & 2 deletions astro.config.mjs → astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import react from "@astrojs/react";
import remarkToc from "remark-toc";
import remarkCollapse from "remark-collapse";
import sitemap from "@astrojs/sitemap";
import { SITE } from "./src/config";

// https://astro.build/config
export default defineConfig({
site: "https://astro-paper.pages.dev/", // replace this with your deployed domain
site: SITE.website,
integrations: [
tailwind({
applyBaseStyles: false,
Expand All @@ -29,7 +30,6 @@ export default defineConfig({
theme: "one-dark-pro",
wrap: true,
},
extendDefaultPlugins: true,
},
vite: {
optimizeDeps: {
Expand Down
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Site, SocialObjects } from "./types";

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",
desc: "A minimal, responsive and SEO-friendly Astro blog theme.",
title: "AstroPaper",
Expand Down
2 changes: 1 addition & 1 deletion src/content/blog/how-to-add-an-estimated-reading-time.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
import { remarkReadingTime } from "./src/utils/remark-reading-time.mjs"; // make sure your relative path is correct
Expand Down
11 changes: 0 additions & 11 deletions src/content/blog/how-to-configure-astropaper-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

| Options | Description |
Expand Down

0 comments on commit 9dcc5e1

Please sign in to comment.