|
1 | | -import { pluginRss } from "@rspress/plugin-rss"; |
2 | 1 | import { defineConfig } from "rspress/config"; |
| 2 | +import { config } from "./rspress.config"; |
3 | 3 |
|
4 | | -const siteUrl = "https://scriptingapp.github.io"; |
| 4 | +config.base = "/doc_v2/"; |
| 5 | +config.outDir = "doc_build_fun"; |
5 | 6 |
|
6 | | -export default defineConfig({ |
7 | | - // root: path.join(__dirname, "docs"), |
8 | | - // outDir: "public", |
9 | | - base: "/doc_v2/", |
10 | | - title: "Scripting", |
11 | | - icon: "/icon.png", |
12 | | - logo: "/logo.png", |
13 | | - logoText: "Scripting", |
14 | | - route: { |
15 | | - cleanUrls: true, |
16 | | - extensions: [".md", ".mdx"], |
17 | | - }, |
18 | | - search: { |
19 | | - codeBlocks: true, |
20 | | - }, |
21 | | - markdown: { |
22 | | - showLineNumbers: true, |
23 | | - defaultWrapCode: false, |
24 | | - }, |
25 | | - plugins: [ |
26 | | - pluginRss({ |
27 | | - siteUrl: siteUrl, |
28 | | - feed: [ |
29 | | - { |
30 | | - id: "changelog", |
31 | | - test: "/guide/changelog/", |
32 | | - title: "Scripting Changelog", |
33 | | - language: "en-US", |
34 | | - }, |
35 | | - { |
36 | | - id: "changelog_zh", |
37 | | - test: "/zh/guide/changelog/", |
38 | | - title: "Scripting 更新日志", |
39 | | - language: "zh-CN", |
40 | | - }, |
41 | | - ], |
42 | | - output: { |
43 | | - dir: "feeds", |
44 | | - type: "rss", |
45 | | - }, |
46 | | - }), |
47 | | - ], |
48 | | - themeConfig: { |
49 | | - // enableScrollToTop: true, |
50 | | - // hideNavbar: "auto", |
51 | | - // lastUpdated: true, // 是否显示最后更新时间 |
52 | | - locales: [ |
53 | | - { |
54 | | - lang: "en", |
55 | | - label: "English", |
56 | | - lastUpdatedText: "Last Updated", |
57 | | - outlineTitle: "Outline", |
58 | | - prevPageText: "Previous Page", |
59 | | - nextPageText: "Next Page", |
60 | | - searchPlaceholderText: "Search", |
61 | | - searchNoResultsText: "No results for", |
62 | | - searchSuggestedQueryText: "Please try again with a different keyword", |
63 | | - overview: { |
64 | | - filterNameText: "Filter", |
65 | | - filterPlaceholderText: "Enter keyword", |
66 | | - filterNoResultText: "No matching API found", |
67 | | - }, |
68 | | - }, |
69 | | - { |
70 | | - lang: "zh", |
71 | | - label: "简体中文", |
72 | | - lastUpdatedText: "最后更新", |
73 | | - outlineTitle: "大纲", |
74 | | - prevPageText: "上一页", |
75 | | - nextPageText: "下一页", |
76 | | - searchPlaceholderText: "搜索", |
77 | | - searchNoResultsText: "没有搜索结果", |
78 | | - searchSuggestedQueryText: "请尝试使用不同的关键词", |
79 | | - overview: { |
80 | | - filterNameText: "筛选", |
81 | | - filterPlaceholderText: "输入关键词", |
82 | | - filterNoResultText: "没有找到匹配的 API", |
83 | | - }, |
84 | | - }, |
85 | | - ], |
86 | | - socialLinks: [ |
87 | | - { |
88 | | - icon: "github", |
89 | | - mode: "link", |
90 | | - content: "https://github.com/ScriptingApp", |
91 | | - }, |
92 | | - { |
93 | | - icon: "X", |
94 | | - mode: "link", |
95 | | - content: "https://x.com/thomfang", |
96 | | - }, |
97 | | - { |
98 | | - icon: { |
99 | | - svg: ` |
100 | | -<svg xmlns="http://www.w3.org/2000/svg" viewBox="32 32 512 512" width="32" height="32" fill="currentColor"> |
101 | | - <mask id="mask-logo"> |
102 | | - <rect width="100%" height="100%" fill="white"/> |
103 | | - <rect x="220" y="340" width="275" height="190" rx="50" ry="50" fill="black"/> |
104 | | - </mask> |
105 | | - <mask id="mask-text"> |
106 | | - <rect x="245" y="360" width="225" height="150" rx="40" ry="40" fill="white"/> |
107 | | - <text x="357" y="480" font-size="120" font-weight="bold" text-anchor="middle" fill="black">EN</text> |
108 | | - </mask> |
109 | | - <path d="M128 416c0 17.7-14.3 32-32 32s-32-14.3-32-32 |
110 | | - 14.3-32 32-32 32 14.3 32 32zm144 32c0-107.5-84.5-192-192-192v64 |
111 | | - c70.7 0 128 57.3 128 128h64zm96 0c0-159.1-128.9-288-288-288v64 |
112 | | - c123.7 0 224 100.3 224 224h64z" |
113 | | - mask="url(#mask-logo)"/> |
114 | | - <rect x="240" y="363" width="235" height="150" rx="40" ry="40" |
115 | | - mask="url(#mask-text)"/> |
116 | | -</svg> |
117 | | - `, |
118 | | - }, |
119 | | - mode: "link", |
120 | | - content: "https://scriptingapp.github.io/feeds/changelog.rss", |
121 | | - }, |
122 | | - { |
123 | | - icon: { |
124 | | - svg: ` |
125 | | -<svg xmlns="http://www.w3.org/2000/svg" viewBox="32 32 512 512" width="32" height="32" fill="currentColor"> |
126 | | - <mask id="mask-logo"> |
127 | | - <rect width="100%" height="100%" fill="white"/> |
128 | | - <rect x="220" y="340" width="275" height="190" rx="50" ry="50" fill="black"/> |
129 | | - </mask> |
130 | | - <mask id="mask-text"> |
131 | | - <rect x="245" y="360" width="225" height="150" rx="40" ry="40" fill="white"/> |
132 | | - <text x="357" y="480" font-size="120" font-weight="bold" text-anchor="middle" fill="black">ZH</text> |
133 | | - </mask> |
134 | | - <path d="M128 416c0 17.7-14.3 32-32 32s-32-14.3-32-32 |
135 | | - 14.3-32 32-32 32 14.3 32 32zm144 32c0-107.5-84.5-192-192-192v64 |
136 | | - c70.7 0 128 57.3 128 128h64zm96 0c0-159.1-128.9-288-288-288v64 |
137 | | - c123.7 0 224 100.3 224 224h64z" |
138 | | - mask="url(#mask-logo)"/> |
139 | | - <rect x="240" y="363" width="235" height="150" rx="40" ry="40" |
140 | | - mask="url(#mask-text)"/> |
141 | | -</svg> |
142 | | - `, |
143 | | - }, |
144 | | - mode: "link", |
145 | | - content: "https://scriptingapp.github.io/feeds/changelog_zh.rss", |
146 | | - }, |
147 | | - ], |
148 | | - }, |
149 | | - lang: "en", |
150 | | - locales: [ |
151 | | - { |
152 | | - lang: "en", |
153 | | - label: "English", |
154 | | - title: "Rspress", |
155 | | - description: "Static Site Generator", |
156 | | - }, |
157 | | - { |
158 | | - lang: "zh", |
159 | | - label: "简体中文", |
160 | | - title: "Rspress", |
161 | | - description: "静态网站生成器", |
162 | | - }, |
163 | | - ], |
164 | | -}); |
| 7 | +export default defineConfig(config); |
0 commit comments