-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathastro.config.ts
216 lines (203 loc) · 6.47 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import remarkCustomHeaderId from "remark-custom-header-id";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import AstroPWA from "@vite-pwa/astro";
import type { ManifestOptions } from "vite-plugin-pwa";
import manifest from "./webmanifest.json";
import starlightBlog from "starlight-blog";
import starlightViewModes from "starlight-view-modes";
import { remarkMark } from "remark-mark-highlight";
// import { remarkCode } from "remark-code";
import mdx from '@astrojs/mdx';
import AutoImport from 'astro-auto-import';
import { readdirSync } from 'node:fs';
// Get a list of all the components in a specific directory:
const componentDir = './src/components/global/';
const components = readdirSync(componentDir);
import starlightUtils from "@lorenzo_lewis/starlight-utils";
import d2 from "astro-d2";
import compress from "astro-compress";
// https://astro.build/config
export default defineConfig({
markdown: {
gfm: false,
rehypePlugins: [[rehypeAutolinkHeadings, {
// Wrap the heading text in a link.
behavior: "wrap",
properties: {
className: ["section_heading"]
}
}]],
remarkPlugins: [remarkCustomHeaderId, remarkMark]
},
site: "https://sanabel-al-firdaws.github.io",
server: {
headers: {
'Cache-Control': 'no-cache'
}
},
// trailingSlash: "always",
integrations: [ AutoImport({
imports: [
// Add paths to each component to the auto-import array:
...components.map(filename => componentDir + filename),
],
}),
starlight({
plugins: [
// starlightImageZoom({
// // Configuration options go here.
// showCaptions: false
// }),
starlightViewModes({
zenModeCloseButtonPosition: 'top-left'
}), starlightUtils({
multiSidebar: {
switcherStyle: "horizontalList"
}
}), starlightBlog({
title: "الْمُدَوَّنَةُ",
postCount: 10,
authors: {
hakkem: {
name: "عبدالحكيم الشنقيطي",
title: "طالب علم",
picture: "/maskable-icon-512x512.png",
// Images in the `public` directory are supported.
url: "https://github.com/sanabel-al-firdaws"
}
}
})],
tableOfContents: {
minHeadingLevel: 1,
maxHeadingLevel: 6
},
customCss: ["./src/styles/custom.css", "./src/fonts/font-face.css"
// Relative path to your custom CSS file
// '@fontsource/scheherazade-new/400.css',
// '@fontsource/scheherazade-new/500.css',
// '@fontsource/scheherazade-new/600.css',
// '@fontsource/scheherazade-new/700.css',
],
components: {
// Override the default `SocialIcons` component.
ThemeProvider: "./src/components/starlight/ThemeProvider.astro",
EditLink: './src/components/starlight/EditLink.astro',
ThemeSelect: "./src/components/blog-override/ThemeSelect.astro",
SocialIcons: "./src/components/starlight/SocialIcons.astro",
Pagination: "./src/components/starlight/Pagination.astro",
// Search: "./src/components/starlight/Search.astro",
// Sidebar: "./src/components/starlight/Sidebar.astro",
LastUpdated: "./src/components/starlight/LastUpdated.astro",
SiteTitle: "./src/components/starlight/SiteTitle.astro",
TableOfContents: "./src/components/starlight/TableOfContents.astro"
// PageFrame: "./src/components/starlight/PageFrame.astro"
},
title: "سَنَابِلُ الْفِرْدَوْسِ",
credits: true,
lastUpdated: true,
description: "المنهج السلفي بأسلوب سلس ومبسط",
// titleDelimiter: '',
defaultLocale: "ar",
locales: {
root: {
label: "العربية",
lang: "ar",
dir: "rtl"
}
},
editLink: {
baseUrl: "https://github.com/sanabel-al-firdaws/sanabel-al-firdaws.github.io/edit/main/"
},
social: {
youtube: "https://www.youtube.com/@سنابل-الفردوس",
telegram: "https://t.me/abdullhakim_alshanqiti",
github: "https://github.com/sanabel-al-firdaws/sanabel-al-firdaws.github.io/"
},
sidebar: [{
label: "شُرُوحُ الْكُتُبِ",
collapsed: true,
items: [{
label: "اللُّغَةُ الْعَرَبِيَّةُ",
collapsed: true,
autogenerate: {
directory: "arabic"
}
}, {
label: "الْقُرْآنُ الْكَرِيمُ",
collapsed: true,
autogenerate: {
directory: "quran"
}
}, {
label: "الْعَقِيدَةُ",
collapsed: true,
autogenerate: {
directory: "aqida"
}
}, {
label: "الرَّقَائِقُ وَالْآدَابُ",
collapsed: true,
autogenerate: {
directory: "raqaiq"
}
}]
}, {
label: "الْمُدَوَّنَةُ",
collapsed: true,
items: [{
label: "كُلُّ الْمَقَالَاتِ",
link: "/blog"
}, {
label: "أَحْدَثُ الْمَقَالَاتِ",
collapsed: true,
autogenerate: {
directory: "blog"
}
}, {
label: "الْأَقْسَامُ",
collapsed: true,
items: [{
label: "شُبُهَاتُ الْخَوَارِجِ",
link: "blog/tags/شبهات-الخوارج"
}]
}]
}]
}), AstroPWA({
// strategies: "injectManifest",
// srcDir: "src",
// filename: "sw.ts",
// useCredentials: true,
// devOptions: {
// enabled: true,
// type: "module"
// },
// injectManifest: {
// globPatterns: ["**/*.{js,css,png,svg,json,woff2,woff,pf_fragment,pf_index,pf_meta,pagefind,wasm}"],
// maximumFileSizeToCacheInBytes: 15000000
// },
workbox: {
skipWaiting: true,
clientsClaim: true,
navigateFallback: "/404",
ignoreURLParametersMatching: [/./],
globPatterns: ["**/*.{html,js,css,png,svg,json,woff2,woff,pf_fragment,pf_index,pf_meta,pagefind,wasm}"]
},
experimental: {
directoryAndTrailingSlashHandler: true
},
mode: "production",
registerType: "autoUpdate",
manifest: manifest as Partial<ManifestOptions>
}), d2({
sketch: true,
layout: "dagre",
theme: {
dark: false,
default: "200"
}
// fonts: { regular: './TNB.ttf', italic: './TNB.ttf',bold: './TNB.ttf'},
}), compress(), mdx(),
]
});