@@ -2,27 +2,21 @@ import { rehypeHeadingIds } from "@astrojs/markdown-remark";
22import starlight from "@astrojs/starlight" ;
33import lunaria from "@lunariajs/starlight" ;
44import { defineConfig } from "astro/config" ;
5+ import { config as loadDotenv } from "dotenv" ;
56import starlightBlog from "starlight-blog" ;
67import starlightCoolerCredit from "starlight-cooler-credit" ;
78import starlightGiscus from "starlight-giscus" ;
89import starlightImageZoom from "starlight-image-zoom" ;
910import starlightLinksValidator from "starlight-links-validator" ;
1011import starlightThemeRapide from "starlight-theme-rapide" ;
11- import { loadEnv } from "vite" ;
1212
1313import rehypeAutolinkHeadings from "./src/plugins/rehype/autolink-headings" ;
1414import rehypeGitHubBadgeLinks from "./src/plugins/rehype/github-badge-links" ;
1515
16- const { GISCUS_REPO_ID } = loadEnv (
17- process . env . GISCUS_REPO_ID ,
18- process . cwd ( ) ,
19- ""
20- ) ;
21- const { GISCUS_CATEGORY_ID } = loadEnv (
22- process . env . GISCUS_CATEGORY_ID ,
23- process . cwd ( ) ,
24- ""
25- ) ;
16+ loadDotenv ( ) ;
17+
18+ const GISCUS_REPO_ID = process . env . GISCUS_REPO_ID ;
19+ const GISCUS_CATEGORY_ID = process . env . GISCUS_CATEGORY_ID ;
2620
2721if ( ! GISCUS_REPO_ID || ! GISCUS_CATEGORY_ID ) {
2822 console . warn (
@@ -112,14 +106,17 @@ export default defineConfig({
112106 errorOnInvalidHashes : false ,
113107 } ) ,
114108 starlightImageZoom ( ) ,
115- starlightThemeRapide ( ) ,
116- starlightCoolerCredit ( {
117- credit : {
118- title : "Credits" ,
119- description : "View all credits of this blog →" ,
120- href : "https://blog.trueberryless.org/credits" ,
121- } ,
122- } ) ,
109+ ...( GISCUS_REPO_ID && GISCUS_CATEGORY_ID
110+ ? [
111+ starlightGiscus ( {
112+ repo : "trueberryless-org/blog" ,
113+ repoId : GISCUS_REPO_ID ,
114+ category : "Comments" ,
115+ categoryId : GISCUS_CATEGORY_ID ,
116+ lazy : true ,
117+ } ) ,
118+ ]
119+ : [ ] ) ,
123120 starlightBlog ( {
124121 title : "Deep Thoughts" ,
125122 postCount : 7 ,
@@ -164,17 +161,14 @@ export default defineConfig({
164161 } ,
165162 } ,
166163 } ) ,
167- ...( GISCUS_REPO_ID && GISCUS_CATEGORY_ID
168- ? [
169- starlightGiscus ( {
170- repo : "trueberryless-org/blog" ,
171- repoId : GISCUS_REPO_ID ,
172- category : "Comments" ,
173- categoryId : GISCUS_CATEGORY_ID ,
174- lazy : true ,
175- } ) ,
176- ]
177- : [ ] ) ,
164+ starlightCoolerCredit ( {
165+ credit : {
166+ title : "Credits" ,
167+ description : "View all credits of this blog →" ,
168+ href : "https://blog.trueberryless.org/credits" ,
169+ } ,
170+ } ) ,
171+ starlightThemeRapide ( ) ,
178172 ] ,
179173 components : {
180174 MarkdownContent : "./src/components/MarkdownContent.astro" ,
0 commit comments