From 97acf73e70c54523644fe65682765b4595f03168 Mon Sep 17 00:00:00 2001 From: Jenxi Date: Tue, 3 Jun 2025 18:40:08 +0800 Subject: [PATCH 01/25] i18n(zh-CN): update Chinese UI strings add Chinese translation config and update Chinese UI strings --- astro.config.mts | 2 +- lunaria.config.ts | 14 +++++------ src/content/i18n/zh-cn.json | 49 +++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 src/content/i18n/zh-cn.json diff --git a/astro.config.mts b/astro.config.mts index b322bcd0..a4c4c00a 100644 --- a/astro.config.mts +++ b/astro.config.mts @@ -34,7 +34,7 @@ export const locales = { fr: { label: 'Français', lang: 'fr' }, // it: { label: 'Italiano', lang: 'it' }, // id: { label: 'Bahasa Indonesia', lang: 'id' }, - // 'zh-cn': { label: '简体中文', lang: 'zh-CN' }, + 'zh-cn': { label: '简体中文', lang: 'zh-CN' }, // 'pt-br': { label: 'Português do Brasil', lang: 'pt-BR' }, // 'pt-pt': { label: 'Português', lang: 'pt-PT' }, ko: { label: '한국어', lang: 'ko' }, diff --git a/lunaria.config.ts b/lunaria.config.ts index b33d1470..7d3e1c3d 100644 --- a/lunaria.config.ts +++ b/lunaria.config.ts @@ -56,13 +56,13 @@ export default defineConfig({ // tag: 'id', // }, // }, - // { - // label: '简体中文', - // lang: 'zh-cn', - // parameters: { - // tag: 'zh-CN', - // }, - // }, + { + label: '简体中文', + lang: 'zh-cn', + parameters: { + tag: 'zh-CN', + }, + }, // { // label: 'Português do Brasil', // lang: 'pt-br', diff --git a/src/content/i18n/zh-cn.json b/src/content/i18n/zh-cn.json new file mode 100644 index 00000000..9cdb0d09 --- /dev/null +++ b/src/content/i18n/zh-cn.json @@ -0,0 +1,49 @@ +{ + "site-title.labels.docs": "文档", + "site-title.labels.main-site": "主站点", + "site-title.labels.live-demo": "在线演示", + "sponsors.sponsoredby": "赞助商", + "package-catalog.readmore.start": "更多信息请查看", + "package-catalog.readmore.end": "文档页面", + "integration-labels.changelog": "更新日志", + "contributors.core-packages": "StudioCMS 核心包", + "contributors.ui-library": "StudioCMS UI 组件库", + "contributors.devapps": "StudioCMS 开发应用", + "contributors.plugins": "StudioCMS 插件", + "contributors.documentation": "StudioCMS 文档", + "contributors.website": "StudioCMS 网站", + "contributors.bots": "StudioCMS 机器人", + "docsearch.button": "搜索", + "docsearch.shortcutLabel": "按 / 键搜索", + "docsearch.placeholder": "搜索文档", + "docsearch.searchBox.resetButtonTitle": "清除查询", + "docsearch.searchBox.resetButtonAriaLabel": "清除查询", + "docsearch.searchBox.cancelButtonText": "取消", + "docsearch.searchBox.cancelButtonAriaLabel": "取消", + "docsearch.searchBox.searchInputLabel": "搜索", + + "docsearch.startScreen.recentSearchesTitle": "最近搜索", + "docsearch.startScreen.noRecentSearchesText": "无最近搜索记录", + "docsearch.startScreen.saveRecentSearchButtonTitle": "保存此搜索", + "docsearch.startScreen.removeRecentSearchButtonTitle": "从历史记录中移除", + "docsearch.startScreen.favoriteSearchesTitle": "收藏搜索", + "docsearch.startScreen.removeFavoriteSearchButtonTitle": "从收藏中移除", + + "docsearch.errorScreen.titleText": "无法获取结果", + "docsearch.errorScreen.helpText": "请检查您的网络连接", + + "docsearch.footer.selectText": "选择", + "docsearch.footer.selectKeyAriaLabel": "回车键", + "docsearch.footer.navigateText": "导航", + "docsearch.footer.navigateUpKeyAriaLabel": "上箭头", + "docsearch.footer.navigateDownKeyAriaLabel": "下箭头", + "docsearch.footer.closeText": "关闭", + "docsearch.footer.closeKeyAriaLabel": "Esc 键", + "docsearch.footer.searchByText": "搜索技术支持", + + "docsearch.noResultsScreen.noResultsText": "无结果:", + "docsearch.noResultsScreen.suggestedQueryText": "尝试搜索:", + "docsearch.noResultsScreen.reportMissingResultsText": "认为该查询应有结果?", + "docsearch.noResultsScreen.reportMissingResultsLinkText": "请告知我们", + "quick-update": "运行以下命令快速更新至最新版本:" +} \ No newline at end of file From 6c309a2d77980bbc2cdb449847920ae93aa73604 Mon Sep 17 00:00:00 2001 From: Jenxi Date: Tue, 3 Jun 2025 20:16:51 +0800 Subject: [PATCH 02/25] Created Chinese pages Created files for Chinese pages --- .../docs/zh-cn/config-reference/dashboard.mdx | 227 ++++++ .../default-frontend-config.mdx | 119 +++ .../zh-cn/config-reference/image-service.mdx | 28 + .../included-integrations.mdx | 56 ++ .../docs/zh-cn/config-reference/index.mdx | 187 +++++ .../docs/zh-cn/config-reference/overrides.mdx | 104 +++ .../docs/zh-cn/config-reference/sdk.mdx | 100 +++ .../contributing/code-contributions.mdx | 64 ++ .../guides/contributing/getting-started.mdx | 27 + .../guides/contributing/translations.mdx | 124 +++ .../zh-cn/guides/database/sqld-server.mdx | 191 +++++ src/content/docs/zh-cn/guides/index.mdx | 20 + .../zh-cn/guides/upgrade/release-notes.md | 742 ++++++++++++++++++ .../upgrade/version-guides/0-1-0-beta-16.mdx | 91 +++ .../upgrade/version-guides/0-1-0-beta-17.mdx | 100 +++ .../upgrade/version-guides/0-1-0-beta-18.mdx | 116 +++ src/content/docs/zh-cn/how-it-works/cli.mdx | 366 +++++++++ src/content/docs/zh-cn/how-it-works/index.mdx | 215 +++++ .../docs/zh-cn/how-it-works/restapi.mdx | 165 ++++ src/content/docs/zh-cn/how-it-works/sdk.mdx | 285 +++++++ src/content/docs/zh-cn/index.mdx | 97 +++ .../community-plugins/web-vitals.mdx | 76 ++ .../docs/zh-cn/package-catalog/index.mdx | 28 + .../studiocms-plugins/studiocms-blog.mdx | 236 ++++++ .../studiocms-plugins/studiocms-devapps.mdx | 127 +++ .../studiocms-plugins/studiocms-markdoc.mdx | 36 + .../studiocms-plugins/studiocms-mdx.mdx | 36 + .../studiocms-plugins/studiocms-wysiwyg.mdx | 36 + src/content/docs/zh-cn/plugins/extended.mdx | 367 +++++++++ src/content/docs/zh-cn/plugins/index.mdx | 129 +++ .../docs/zh-cn/start-here/configuration.mdx | 87 ++ .../start-here/environment-variables.mdx | 110 +++ src/content/docs/zh-cn/start-here/gallery.mdx | 15 + .../docs/zh-cn/start-here/getting-started.mdx | 346 ++++++++ .../docs/zh-cn/start-here/why-studioCMS.mdx | 36 + src/content/docs/zh-cn/utils/rendering.mdx | 38 + src/starlight-sidebar/zh-cn.json | 21 + 37 files changed, 5148 insertions(+) create mode 100644 src/content/docs/zh-cn/config-reference/dashboard.mdx create mode 100644 src/content/docs/zh-cn/config-reference/default-frontend-config.mdx create mode 100644 src/content/docs/zh-cn/config-reference/image-service.mdx create mode 100644 src/content/docs/zh-cn/config-reference/included-integrations.mdx create mode 100644 src/content/docs/zh-cn/config-reference/index.mdx create mode 100644 src/content/docs/zh-cn/config-reference/overrides.mdx create mode 100644 src/content/docs/zh-cn/config-reference/sdk.mdx create mode 100644 src/content/docs/zh-cn/guides/contributing/code-contributions.mdx create mode 100644 src/content/docs/zh-cn/guides/contributing/getting-started.mdx create mode 100644 src/content/docs/zh-cn/guides/contributing/translations.mdx create mode 100644 src/content/docs/zh-cn/guides/database/sqld-server.mdx create mode 100644 src/content/docs/zh-cn/guides/index.mdx create mode 100644 src/content/docs/zh-cn/guides/upgrade/release-notes.md create mode 100644 src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx create mode 100644 src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx create mode 100644 src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx create mode 100644 src/content/docs/zh-cn/how-it-works/cli.mdx create mode 100644 src/content/docs/zh-cn/how-it-works/index.mdx create mode 100644 src/content/docs/zh-cn/how-it-works/restapi.mdx create mode 100644 src/content/docs/zh-cn/how-it-works/sdk.mdx create mode 100644 src/content/docs/zh-cn/index.mdx create mode 100644 src/content/docs/zh-cn/package-catalog/community-plugins/web-vitals.mdx create mode 100644 src/content/docs/zh-cn/package-catalog/index.mdx create mode 100644 src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-blog.mdx create mode 100644 src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-devapps.mdx create mode 100644 src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-markdoc.mdx create mode 100644 src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-mdx.mdx create mode 100644 src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-wysiwyg.mdx create mode 100644 src/content/docs/zh-cn/plugins/extended.mdx create mode 100644 src/content/docs/zh-cn/plugins/index.mdx create mode 100644 src/content/docs/zh-cn/start-here/configuration.mdx create mode 100644 src/content/docs/zh-cn/start-here/environment-variables.mdx create mode 100644 src/content/docs/zh-cn/start-here/gallery.mdx create mode 100644 src/content/docs/zh-cn/start-here/getting-started.mdx create mode 100644 src/content/docs/zh-cn/start-here/why-studioCMS.mdx create mode 100644 src/content/docs/zh-cn/utils/rendering.mdx create mode 100644 src/starlight-sidebar/zh-cn.json diff --git a/src/content/docs/zh-cn/config-reference/dashboard.mdx b/src/content/docs/zh-cn/config-reference/dashboard.mdx new file mode 100644 index 00000000..9c607d5b --- /dev/null +++ b/src/content/docs/zh-cn/config-reference/dashboard.mdx @@ -0,0 +1,227 @@ +--- +i18nReady: true +title: "仪表板配置" +description: "StudioCMSOptions dashboardConfig 参考文档" +sidebar: + order: 6 +--- + +import ReadMore from '~/components/ReadMore.astro'; + +StudioCMS 集成配置选项架构参考 + +```ts twoslash title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + dashboardConfig: { + dashboardEnabled: true, + dashboardRouteOverride: 'dashboard', + developerConfig: {}, + faviconURL: '/favicon.svg', + inject404Route: true, + versionCheck: true, + AuthConfig: {}, + }, +}); +``` + +## `dashboardEnabled` + +`dashboardEnabled` 是用于确定是否启用仪表板的布尔值。 + +- **类型:** `boolean` +- **默认值:** `true` + +### 用法示例 + +```ts twoslash {3} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + dashboardConfig: { + dashboardEnabled: true, // 默认值 - 启用仪表板 + } +}) +``` + +## `DashboardRouteOverride` + +`DashboardRouteOverride` 是用于设置仪表板路由路径的字符串。 + +- **类型:** `string` +- **默认值:** `'dashboard'` + +### 用法示例 + +```ts twoslash {3} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + dashboardConfig: { + dashboardRouteOverride: 'dashboard', // 默认值 - 设置仪表板路由为 /dashboard + } +}) +``` + +## `developerConfig` + +`developerConfig` 是用于配置仪表板开发者设置的对象。 + +### 用法示例 + +```ts twoslash {3-5} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + dashboardConfig: { + developerConfig: { + demoMode: false, // 默认值 - 禁用演示模式 + }, + } +}) +``` + +## `faviconURL` + +`faviconURL` 是用于设置仪表板网站图标的路径字符串。 + +- **类型:** `string` +- **默认值:** `'/favicon.svg'` + +### 用法示例 + +```ts twoslash {3} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + dashboardConfig: { + faviconURL: '/favicon.svg', // 默认值 - 设置仪表板网站图标 + } +}) +``` + +## `inject404Route` + +`inject404Route` 是用于确定是否注入404路由的布尔值。 + +- **类型:** `boolean` +- **默认值:** `true` + +### 用法示例 + +```ts twoslash {3} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + dashboardConfig: { + inject404Route: true, // 默认值 - 注入404路由 + } +}) +``` + +## `versionCheck` + +`versionCheck` 是用于确定是否启用版本检查的布尔值。 + +- **类型:** `boolean` +- **默认值:** `true` + +### 用法示例 + +```ts twoslash {3} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + dashboardConfig: { + versionCheck: true, // 默认值 - 启用版本检查 + } +}) +``` + +## `AuthConfig` + +`AuthConfig` 是用于配置仪表板认证设置的对象。 + +### 用法示例 + +```ts twoslash {3-5} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + dashboardConfig: { + AuthConfig: { + enabled: true, // 默认值 - 启用认证功能 + }, + } +}) +``` + +### `providers` + +`providers` 是用于配置仪表板认证提供商的对象。 + +- **类型:** [`AuthProviders`](#authprovider) +- **默认值:** `{}` + +#### 用法示例 + +```ts twoslash {4-11} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + dashboardConfig: { + AuthConfig: { + providers: { + google: true, + github: true, + discord: true, + auth0: true, + usernameAndPassword: true, + usernameAndPasswordConfig: {}, + }, + }, + }, +}) +``` + +#### `usernameAndPasswordConfig` + +`usernameAndPasswordConfig` 是用于配置用户名密码认证设置的对象。 + +- **类型:** `{ allowUserRegistration?: boolean }` +- **默认值:** `{}` + +##### 用法示例 + +```ts twoslash {5-8} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + dashboardConfig: { + AuthConfig: { + providers: { + usernameAndPassword: true, + usernameAndPasswordConfig: { + allowUserRegistration: true, // 默认值 - 允许用户注册 + }, + }, + }, + }, +}) +``` + +###### `AuthProvider` + +```ts +type AuthProviders: { + github?: boolean | undefined; + discord?: boolean | undefined; + google?: boolean | undefined; + auth0?: boolean | undefined; + usernameAndPassword?: boolean | undefined; + usernameAndPasswordConfig?: { + allowUserRegistration?: boolean | undefined; + } | undefined; +} | undefined +``` \ No newline at end of file diff --git a/src/content/docs/zh-cn/config-reference/default-frontend-config.mdx b/src/content/docs/zh-cn/config-reference/default-frontend-config.mdx new file mode 100644 index 00000000..b5c7c11c --- /dev/null +++ b/src/content/docs/zh-cn/config-reference/default-frontend-config.mdx @@ -0,0 +1,119 @@ +--- +i18nReady: true +title: "默认前端配置" +description: "StudioCMSOptions defaultFrontEndConfig 参考文档" +sidebar: + order: 5 +--- + +import ReadMore from '~/components/ReadMore.astro'; + +StudioCMS 集成配置选项架构参考 + +```ts twoslash title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + defaultFrontEndConfig: { + favicon: '/favicon.svg', + htmlDefaultLanguage: 'en', + htmlDefaultHead: [], + injectQuickActionsMenu: true, + }, +}); +``` + +## `favicon` + +`favicon` 是用于设置网站图标路径的字符串。 + +- **类型:** `string` +- **默认值:** `'/favicon.svg'` + +### 用法示例 + +```ts twoslash {3} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + defaultFrontEndConfig: { + favicon: '/favicon.svg', // 默认值 - 使用默认网站图标 + } +}) +``` + +## `htmlDefaultLanguage` + +`htmlDefaultLanguage` 是用于设置网站默认语言的字符串。 + +- **类型:** `string` +- **默认值:** `'en'` + +### 用法示例 + +```ts twoslash {3} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + defaultFrontEndConfig: { + htmlDefaultLanguage: 'en', // 默认值 - 使用默认语言 + } +}) +``` + +## `htmlDefaultHead` + +**类型:** [`HeadConfig[]`](#headconfig) + +向网站头部区域添加自定义标签。适用于添加分析工具脚本和第三方资源。 + +```ts twoslash {3} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + defaultFrontEndConfig: { + htmlDefaultHead: [ + // 示例:添加 Fathom 分析脚本 + { + tag: 'script', + attrs: { + src: 'https://cdn.usefathom.com/script.js', + 'data-site': 'MY-FATHOM-ID', + defer: true, + }, + }, + ], + }, +}); +``` + +`htmlDefaultHead` 中的内容会直接转换为 HTML 元素,不会经过 Astro 的 [脚本处理](https://docs.astro.build/zh-cn/guides/client-side-scripts/#script-processing) 或 [样式处理](https://docs.astro.build/zh-cn/guides/styling/#styling-in-astro)。 + +#### `HeadConfig` + +```ts +interface HeadConfig { + tag: string; // HTML标签名 + attrs?: Record; // 标签属性 + content?: string; // 标签内容 +} +``` + +## `injectQuickActionsMenu` + +**类型:** `boolean` +**默认值:** `true` + +在网站右下角注入快速操作菜单界面,允许用户快速访问 StudioCMS 管理后台。 + +### 用法示例 + +```ts twoslash {3} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + defaultFrontEndConfig: { + injectQuickActionsMenu: true, // 默认值 - 注入快速操作菜单 + } +}) +``` \ No newline at end of file diff --git a/src/content/docs/zh-cn/config-reference/image-service.mdx b/src/content/docs/zh-cn/config-reference/image-service.mdx new file mode 100644 index 00000000..152f5726 --- /dev/null +++ b/src/content/docs/zh-cn/config-reference/image-service.mdx @@ -0,0 +1,28 @@ +--- +i18nReady: true +title: "图像服务" +description: "StudioCMSOptions imageService 参考文档" +sidebar: + order: 4 +--- + +import ReadMore from '~/components/ReadMore.astro'; + +StudioCMS 集成配置选项架构参考 + +```ts twoslash title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + imageService: { + cdnPlugin: 'cloudinary-js' + }, +}); +``` + +## `cdnPlugin` + +`cdnPlugin` 是一个枚举值,用于指定启用的图像处理 CDN 插件。 + +- **类型:** `'cloudinary-js'` | `undefined` +- **默认值:** `undefined` \ No newline at end of file diff --git a/src/content/docs/zh-cn/config-reference/included-integrations.mdx b/src/content/docs/zh-cn/config-reference/included-integrations.mdx new file mode 100644 index 00000000..e6d6e501 --- /dev/null +++ b/src/content/docs/zh-cn/config-reference/included-integrations.mdx @@ -0,0 +1,56 @@ +--- +i18nReady: true +title: "内置集成功能" +description: "StudioCMSOptions IncludedIntegrations 参考文档" +sidebar: + order: 7 +--- + +import ReadMore from '~/components/ReadMore.astro'; + +StudioCMS 集成配置选项架构参考 + +```ts twoslash title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + includedIntegrations: { + robotsTXT: true + }, +}); +``` + +## `robotsTXT` + +`robotsTXT` 是一个布尔值或对象配置,用于控制是否启用 robots.txt 文件功能。 + +- **类型:** `boolean` | [`RobotsConfig`](#robotsconfig) | `undefined` +- **默认值:** `true` + +### 用法示例 + +```ts twoslash {3} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + includedIntegrations: { + robotsTXT: true, // 默认值 - 启用 robots.txt 文件功能 + } +}) +``` + +##### `RobotsConfig` 配置接口 + +```ts +interface RobotsConfig { + host?: boolean | string; // 网站主域名配置 + sitemap?: boolean | string | string[]; // 站点地图URL配置 + policy?: { // 爬虫规则策略 + userAgent?: string; // 目标用户代理 + disallow?: string | string[]; // 禁止访问路径 + allow?: string | string[]; // 允许访问路径 + crawlDelay?: number; // 爬取延迟(秒) + cleanParam?: string | string[]; // 需要清除的参数 + }[] | undefined; +} +``` \ No newline at end of file diff --git a/src/content/docs/zh-cn/config-reference/index.mdx b/src/content/docs/zh-cn/config-reference/index.mdx new file mode 100644 index 00000000..0acc65d7 --- /dev/null +++ b/src/content/docs/zh-cn/config-reference/index.mdx @@ -0,0 +1,187 @@ +--- +i18nReady: true +title: "StudioCMSOptions 配置总览" +description: "StudioCMSOptions 核心配置参考文档" +sidebar: + order: 1 +--- + +import ReadMore from '~/components/ReadMore.astro'; + +StudioCMS 集成配置选项架构参考 + +```ts twoslash title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +// 以下为默认值示例 +export default defineStudioCMSConfig({ + dbStartPage: true, + dateLocale: 'en-us', + verbose: false, + plugins: [], + componentRegistry: {}, + overrides: {}, + imageService: {}, + defaultFrontEndConfig: {}, + dashboardConfig: {}, + includedIntegrations: {}, + dateTimeFormat: {}, + sdk: {}, + pageTypeOptions: {} +}); +``` + +## `dbStartPage` + +项目初始化页面 - 用于首次设置时创建数据库配置。 + +- **类型:** `boolean` +- **默认值:** `true` + +### 用法示例 + +```ts twoslash {2} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + dbStartPage: true, // 默认值 - 注入初始化页面用于数据库配置 +}) +``` + +## `dateLocale` + +`dateLocale` 是用于设置日期格式化的区域字符串。 + +- **类型:** `string` +- **默认值:** `'en-us'` + +### 用法示例 + +```ts twoslash {2} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + dateLocale: 'en-us', // 默认值 - 设置日期格式化的区域 +}) +``` + +## `verbose` + +`verbose` 是用于启用或禁用详细日志记录的布尔值。 + +- **类型:** `boolean` +- **默认值:** `false` + +### 用法示例 + +```ts twoslash {2} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + verbose: false, // 默认值 - 关闭详细日志记录 +}) +``` + +## `plugins` + +`plugins` 是用于加载插件的数组配置。 + +- **类型:** `StudioCMSPlugin[]` +- **默认值:** `[]` + +### 用法示例 + +```ts twoslash {1, 3-5} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +import blog from '@studiocms/blog'; +export default defineStudioCMSConfig({ + plugins: [ + blog(), + ], +}) +``` + +## `componentRegistry` + +`componentRegistry` 是用于注册组件的对象配置。 + +- **类型:** `Record` +- **默认值:** `{}` + +### 用法示例 + +```ts twoslash {2-4} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + componentRegistry: { + 'my-component': 'src/components/MyComponent.astro', + }, +}) +``` + +## `dateTimeFormat` + +`dateTimeFormat` 是用于配置日期时间格式的对象。 + +- **类型:** `Intl.DateTimeFormatOptions` +- **默认值:** `{}` + +### 用法示例 + +```ts twoslash {2-6} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + dateTimeFormat: { + year: "numeric", // 年份(数字) + month: "short", // 月份(简写) + day: "numeric" // 日期(数字) + }, +}) +``` + +## `overrides` + +`overrides` 是用于覆盖默认配置的对象。 + +[查看 `overrides` 完整选项][overrides] + +## `imageService` + +`imageService` 是用于配置图像服务的对象。 + +[查看 `imageService` 完整选项][image-service] + +## `defaultFrontEndConfig` + +`defaultFrontEndConfig` 是用于配置默认前端的对象。 + +[查看 `defaultFrontEndConfig` 完整选项][default-frontend-config] + +## `dashboardConfig` + +`dashboardConfig` 是用于配置仪表板的对象。 + +[查看 `dashboardConfig` 完整选项][dashboard] + +## `includedIntegrations` + +`includedIntegrations` 是用于配置内置集成功能的对象。 + +[查看 `includedIntegrations` 完整选项][included-integrations] + +## `sdk` + +`sdk` 是用于配置 SDK 的对象。 + +[查看 `sdk` 完整选项][sdk] + +{/* 文档内部链接 */} +[overrides]: /zh-cn/config-reference/overrides/ +[image-service]: /zh-cn/config-reference/image-service/ +[default-frontend-config]: /zh-cn/config-reference/default-frontend-config/ +[dashboard]: /zh-cn/config-reference/dashboard/ +[included-integrations]: /zh-cn/config-reference/included-integrations/ +[sdk]: /zh-cn/config-reference/sdk/ \ No newline at end of file diff --git a/src/content/docs/zh-cn/config-reference/overrides.mdx b/src/content/docs/zh-cn/config-reference/overrides.mdx new file mode 100644 index 00000000..1ddda98e --- /dev/null +++ b/src/content/docs/zh-cn/config-reference/overrides.mdx @@ -0,0 +1,104 @@ +--- +i18nReady: true +title: "配置覆盖" +description: "StudioCMSOptions overrides 参考文档" +sidebar: + order: 2 +--- + +import ReadMore from '~/components/ReadMore.astro'; + +StudioCMS 集成配置选项架构参考 + +```ts twoslash title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + overrides: { + CustomImageOverride: 'src/components/CustomImage.astro', + FormattedDateOverride: 'src/components/FormattedDate.astro', + }, +}); +``` + +## `CustomImageOverride` + +`CustomImageOverride` 是用于指定自定义图像组件路径的字符串配置。 + +- **类型:** `string` +- **默认值:** `undefined`(未定义) + +### 用法示例 + +```ts twoslash {3} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + overrides: { + CustomImageOverride: 'src/components/CustomImage.astro', + }, +}) +``` + +## `FormattedDateOverride` + +`FormattedDateOverride` 是用于指定自定义日期组件路径的字符串配置。 + +- **类型:** `string` +- **默认值:** `undefined`(未定义) + +### 用法示例 + +```ts twoslash {3} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + overrides: { + FormattedDateOverride: 'src/components/FormattedDate.astro', + }, +}) +``` + +### 默认日期组件实现 + +```astro title="FormattedDate.astro" +--- +import config from 'studiocms:config'; // 导入StudioCMS配置 + +interface Props { + date: Date; // 日期属性 +} + +const datetime = Astro.props.date.toISOString(); // 转换为ISO格式 +const formattedDate = Astro.props.date.toLocaleDateString( + config.dateLocale, // 使用配置的区域设置 + config.dateTimeFormat // 使用配置的日期时间格式 +); +--- + + +``` + +### 配置说明: + +1. **覆盖机制**: + - 当指定 `CustomImageOverride` 时,StudioCMS 将使用您的自定义组件替代默认图像组件 + - `FormattedDateOverride` 同理覆盖默认日期格式化组件 + +2. **组件要求**: + - 自定义组件必须实现与默认组件相同的 props 接口 + - 图像组件需支持 StudioCMS 的图像处理参数 + - 日期组件需接收 `date: Date` 属性 + +> **注意**:默认组件代码展示了基础实现逻辑,覆盖后仍需保持兼容性。您可以在自定义组件中扩展功能,但需确保核心输出格式保持不变以避免渲染异常。组件路径应为相对项目根目录的有效路径。 + +### 最佳实践: +```ts +// 建议为覆盖组件创建独立目录 +overrides: { + CustomImageOverride: 'src/components/studiocms/CustomImage.astro', + FormattedDateOverride: 'src/components/studiocms/CustomDate.astro', +} +``` + +所有覆盖配置应在 `studiocms.config.mjs` 文件中进行,修改后需重启开发服务器生效。 \ No newline at end of file diff --git a/src/content/docs/zh-cn/config-reference/sdk.mdx b/src/content/docs/zh-cn/config-reference/sdk.mdx new file mode 100644 index 00000000..f76a66d6 --- /dev/null +++ b/src/content/docs/zh-cn/config-reference/sdk.mdx @@ -0,0 +1,100 @@ +--- +i18nReady: true +title: "SDK 配置" +description: "StudioCMSOptions sdk 参考文档" +sidebar: + order: 8 +--- + +import ReadMore from '~/components/ReadMore.astro'; + +StudioCMS 集成配置选项架构参考 + +```ts twoslash title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + sdk: { + cacheConfig: {}, + }, +}); +``` + +## `cacheConfig` + +`cacheConfig` 是用于配置 SDK 缓存行为的对象。 + +- **类型:** `boolean` | `{ lifetime?: string | undefined; }` | `undefined` +- **默认值:** `{}` + +### 用法示例 + +```ts twoslash {3-7} title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + sdk: { + // 默认配置 - 使用5分钟缓存生命周期 + cacheConfig: { + lifetime: '5m', // 缓存有效期(5分钟) + }, + } +}) +``` + +### 缓存配置详解 + +#### 基本缓存配置选项: + +| 配置项 | 类型 | 描述 | 示例值 | +|-----------|----------|----------------------------------|-------------| +| `lifetime`| `string` | 缓存有效期时间字符串 | `'5m'`(5分钟) | + +#### 时间单位支持: + +- `s` - 秒 (seconds) +- `m` - 分 (minutes) +- `h` - 小时 (hours) +- `d` - 天 (days) + +#### 禁用缓存: + +```ts twoslash {4} title="完全禁用缓存" +import { defineStudioCMSConfig } from 'studiocms/config'; +// ---cut--- +export default defineStudioCMSConfig({ + sdk: { + cacheConfig: false, // 完全禁用SDK缓存 + } +}) +``` + +#### 默认缓存行为: +当不配置 `cacheConfig` 时,SDK 将启用默认缓存策略: +- API响应数据缓存:5分钟 +- 数据库查询结果缓存:2分钟 +- 实时数据(如用户会话)不缓存 + +> **性能提示**:对于内容变动频繁的场景,建议缩短缓存时间(如 `'1m'`)或设置为 `false`。对于静态内容主导的站点,可延长缓存时间(如 `'24h'`)以提升性能。 + +```ts +// 高级缓存配置示例(仅适用于Enterprise版本) +cacheConfig: { + lifetime: '10m', + strategy: 'stale-while-revalidate', // 后台更新策略 + types: { + api: '5m', + database: '10m', + assets: '24h' + } +} +``` + +### 缓存工作原理: +1. 当SDK获取数据时,先检查缓存是否存在有效副本 +2. 若存在且未过期,直接返回缓存数据 +3. 若不存在或已过期,从数据源获取最新数据 +4. 新数据存入缓存并设置有效期 +5. 返回最新数据给调用方 + +所有缓存操作对应用代码透明,开发者无需手动管理缓存生命周期。 \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx b/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx new file mode 100644 index 00000000..2770446d --- /dev/null +++ b/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx @@ -0,0 +1,64 @@ +--- +i18nReady: true +title: 代码贡献指南 +description: 了解如何为 StudioCMS 贡献代码 +sidebar: + order: 2 +--- + +import { Steps } from '@astrojs/starlight/components'; + +本指南将概述完整的贡献流程:从提交问题、创建 PR、审核到合并 PR。 + +如果您想为本项目贡献代码,请遵循以下步骤: + +## 解决现有问题 + +浏览我们的[现有问题](https://github.com/withstudiocms/studiocms/issues),寻找您感兴趣的任务。您可以使用`标签`作为筛选器缩小搜索范围。如果找到要处理的问题,欢迎提交包含修复方案的 PR。 + +## 进行更改 + + +1. **分叉仓库** + - 使用 GitHub Desktop: + - [GitHub Desktop 入门指南](https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/getting-started-with-github-desktop)将引导您设置 Desktop + - 设置完成后,您可以用它来[分叉仓库](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/cloning-and-forking-repositories-from-github-desktop)! + + - 使用命令行: + - [分叉仓库](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo#fork-an-example-repository),这样您可以在准备好合并更改前不影响原始项目 + +2. **安装或更新 Node.js 和 pnpm**,版本需符合 [`.prototools`](https://github.com/withstudiocms/studiocms/blob/main/.prototools) 中的指定要求 + +3. **创建工作分支并开始您的更改!** + +4. **为您的更改编写测试**(如果适用) + +5. **更新文档**(如果需要) + + +## 提交更改 + +当您对更改满意后,提交这些更改。 + +## 拉取请求 (PR) + +完成更改后,创建拉取请求(也称为 PR)。 +- 填写"准备审核"模板,以便我们审核您的 PR。此模板帮助审核者理解您的更改以及 PR 的目的 +- 如果您正在解决问题,别忘了[将 PR 链接到问题](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) +- 启用[允许维护者编辑](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)复选框,以便可以更新分支进行合并 + +提交 PR 后,文档团队成员将审核您的提案。我们可能会提出问题或要求提供额外信息。 +- 在 PR 合并前,我们可能会要求进行更改,可能使用[建议的更改](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request)或 PR 评论。您可以直接通过 UI 应用建议的更改。您可以在自己的分叉中进行任何其他更改,然后将它们提交到您的分支 +- 当您更新 PR 并应用更改时,将每个对话标记为[已解决](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations) +- 如果遇到任何合并问题,请查看此 [Git 教程](https://github.com/skills/resolve-merge-conflicts)以帮助您解决合并冲突和其他问题 + +## 您的 PR 已合并! + +恭喜!StudioCMS 团队感谢您。您的贡献将成为下一个版本的一部分。 + +现在您已成为 StudioCMS 社区的一员,可以帮助我们审核其他 PR、回答问题并帮助其他贡献者。如果尚未加入,请参加我们的 [Discord](https://chat.studiocms.dev),与其他贡献者和 StudioCMS 团队联系。 + +哦,您还会在[贡献者列表][contributors]中看到自己!🎉 + +{/* 链接 */} +[contributors]: /zh-cn/guides/contributing/getting-started/#我们的贡献者 \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/contributing/getting-started.mdx b/src/content/docs/zh-cn/guides/contributing/getting-started.mdx new file mode 100644 index 00000000..1000842f --- /dev/null +++ b/src/content/docs/zh-cn/guides/contributing/getting-started.mdx @@ -0,0 +1,27 @@ +--- +i18nReady: true +title: 入门指南 +description: 学习为 StudioCMS 贡献的基础知识 +sidebar: + order: 1 +--- +import ContributorList from '~/components/ContributorList.astro'; + +感谢您投入时间贡献我们的项目! + +请阅读我们的[行为准则](https://github.com/withstudiocms/studiocms?tab=coc-ov-file#code-of-conduct-),以保持社区的可亲近性和尊重氛围。 + +我们欢迎社区的各种贡献!无论是错误报告、功能请求还是代码贡献,我们都感激您帮助项目变得更好。要自信地浏览我们的代码库,请参阅[工作原理][how-it-works]部分。 + +## 我们的贡献者 + +项目的存在归功于所有参与贡献的人。[在 GitHub 上加入我们](https://github.com/withstudiocms/studiocms),您的个人资料图片将自动出现在此列表中: + + + +## 错误报告与功能请求 + +如果您遇到错误或想建议新功能,请在[GitHub 仓库](https://github.com/withstudiocms/studiocms)上提交问题。创建新问题时,请提供尽可能多的细节,包括重现问题的步骤(针对错误)以及对提议功能的清晰描述。 + +{/* 链接 */} +[how-it-works]: /zh-cn/how-it-works/ \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/contributing/translations.mdx b/src/content/docs/zh-cn/guides/contributing/translations.mdx new file mode 100644 index 00000000..26748315 --- /dev/null +++ b/src/content/docs/zh-cn/guides/contributing/translations.mdx @@ -0,0 +1,124 @@ +--- +i18nReady: true +title: 翻译贡献指南 +description: 了解如何为 StudioCMS 贡献翻译 +sidebar: + order: 2 +--- + +import ReadMore from '~/components/ReadMore.astro'; +import { FileTree } from '@astrojs/starlight/components'; + +StudioCMS 是一个全球化项目,我们致力于让所有人都能使用它。如果您精通多种语言,欢迎帮助我们将 StudioCMS 翻译成您的母语。 + +## 加入 Discord 社区 + +开始翻译前,请先加入我们的 [Discord 聊天室](https://chat.studiocms.dev)。 + +加入 Discord 意味着您可以: +- 实时获取问题解答 +- 与其他译者协调工作,避免重复劳动 +- 参与 i18n 讨论和样式指南制定 +- 学习最佳实践并参与决策 + +:::tip[无法访问 Discord?] +我们依然欢迎您的参与!请在 GitHub 上为[文档](https://github.com/withstudiocms/docs/issues/new/choose)或[核心包](https://github.com/withstudiocms/studiocms/issues/new/choose)创建新问题提问。 +::: + +## 核心包翻译 + +当前翻译状态: + +翻译状态 + +访问[我们的 i18n 控制面板](https://i18n.studiocms.dev)帮助翻译 StudioCMS 核心包。如果您的语言未列出,可直接在控制面板中添加。 + +### 通过 GitHub 贡献 +翻译文件位于 [`packages/studiocms/src/lib/i18n/translations`](https://github.com/withstudiocms/studiocms/tree/main/packages/studiocms/src/lib/i18n/translations/) 目录。英文参考文件为 [`en.json`](https://github.com/withstudiocms/studiocms/blob/main/packages/studiocms/src/lib/i18n/translations/en.json)。 + +无论通过 Crowdin 还是 GitHub 贡献,信息都会自动同步并在下个版本发布。 + + +所有 StudioCMS 包使用 [Crowdin](https://crowdin.com/) 管理翻译。新手可查阅 Crowdin 官网的[译者指南](https://support.crowdin.com/for-translators/)。 + + +翻译添加后,将被集成到 [StudioCMS i18n 配置](https://github.com/withstudiocms/studiocms/blob/main/packages/studiocms/src/lib/i18n/index.ts#L8)中。 + +## 文档翻译 + +StudioCMS 正在积极将文档翻译成多种语言,当前重点语言包括: + +- 西班牙语 +- 法语 +- 德语 +- 韩语 + +衷心感谢社区译者的无私奉献!由于新增语言需要组建团队维护多代码库,我们优先支持已有翻译团队的语言。 + +### 快速入门 + +访问[翻译追踪器](https://i18n.docs.studiocms.dev)查看实时状态: +- 页面更新状态 +- 需要修改的内容 +- 待审核的 PR + +或在 GitHub 直接操作: +1. 按 i18n 标签筛选您语言的 PR +2. 检查拼写和翻译准确性 +3. 提交审核意见 + +### 文档结构 + +文档仓库包含三类可翻译内容: + + + +- ... +- src/ + - ... + - content/ + - docs/ MDX 页面内容(按语言分目录) + - de/ + - en/ + - es/ + - ... + - i18n/ UI 字符串翻译(按语言分文件) + - de.json + - en.json + - es.json + - ... + - starlight-sidebar/ 侧边栏翻译(按语言分文件) + - de.json + - en.json + - es.json + - ... +- astro.config.ts +- package.json +- ... + + + +### 翻译流程 + +按内容类型定位文件: +1. **页面内容**(标题、正文等) + ➤ `src/content/docs/{语言代码}/{页面标识}.mdx` + +2. **共享文本**(搜索框、右侧边栏、"下一篇文章"链接等) + ➤ `src/content/i18n/{语言代码}.json` + +3. **主侧边栏翻译** + ➤ `src/starlight-sidebar/{语言代码}.json` + +开始前: +1. 检查[翻译追踪器](https://i18n.docs.studiocms.dev/) +2. 查看现有 PR 避免重复 +3. 在 Discord 的 `docs-i18n` 频道声明工作内容 + +:::note +不确定某内容是否需要翻译?组件如何工作?请查阅[参考文档](/en/config-reference/)。 +::: + +:::caution +并非所有页面都开放翻译。我们根据页面稳定性逐步开放,**请勿翻译**右侧边栏"贡献"区域没有"翻译此页"按钮的页面。 +::: \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/database/sqld-server.mdx b/src/content/docs/zh-cn/guides/database/sqld-server.mdx new file mode 100644 index 00000000..80bc915d --- /dev/null +++ b/src/content/docs/zh-cn/guides/database/sqld-server.mdx @@ -0,0 +1,191 @@ +--- +i18nReady: true +title: 自托管 libSQL 服务器 +description: 使用 Docker 托管您的 sqld libSQL 服务器 +--- + +import ReadMore from '~/components/ReadMore.astro' +import { PackageManagers } from 'studiocms-package-managers' +import { FileTree, TabItem, Tabs, Steps, Aside } from '@astrojs/starlight/components'; + +`sqld`(SQL 守护进程)是由 Turso 开发的 libSQL 服务器模式。本指南将介绍如何通过 Docker 容器设置和配置 `sqld` 以用于 StudioCMS 项目。 + +通过[官方文档][sql-docs]了解更多关于 `sqld` 的信息 + +## 先决条件 + +- [Docker 和 Docker Compose][docker-docs](可在服务器或本地运行) +- 已安装 [OpenSSL][openssl-docs] +- StudioCMS CLI(位于 StudioCMS 项目根目录) + +本地测试时的最终文件结构示例: + + + +- docker-compose.yml +- data/ +- keys/ +- my-studiocms-project/ + - astro.config.mjs + - studiocms.config.mjs + - package.json + - src/ + + + +## 生成公私钥对 + +在 `keys` 目录中执行以下命令创建 PKCS#8 编码的 Ed25519 密钥对: +```bash +openssl genpkey -algorithm Ed25519 -out ./libsql.pem +``` + +提取公钥: +```bash +openssl pkey -in ./libsql.pem -pubout -out ./libsql.pub +``` + +这将生成用于 `sqld` 服务器的 PKCS#8 密钥对。 + +## 生成 JWT 令牌 + +进入 StudioCMS 项目目录并执行: + + + +输出包含标准格式和 Base64URL 编码的 JWT 认证令牌,用于 libSQL 身份验证。该令牌有效期为 1 年! + +### 更新 StudioCMS 的 `.env` 文件 + +```sh +ASTRO_DB_REMOTE_URL=http://localhost:8080 # 指向 Docker 服务器/本地系统 +ASTRO_DB_APP_TOKEN= # 粘贴您的标准 JWT 认证令牌 +``` + +## 配置 Docker 容器 + +在 StudioCMS 项目目录外创建 `docker-compose.yml` 文件。您有两种配置 libSQL 认证的方式: + + + + + +```yml +services: + libsql: + image: ghcr.io/tursodatabase/libsql-server:latest + platform: linux/amd64 + ports: + - "8080:8080" # HTTP API 端口 + - "5001:5001" # gRPC 端口 + environment: + - SQLD_NODE=primary # 主节点模式 + - SQLD_AUTH_JWT_KEY_FILE=/home/.ssh/libsql.pub # 公钥路径 + volumes: + - ./data/libsql:/var/lib/sqld # 数据持久化 + - ./keys/libsql.pub:/home/.ssh/libsql.pub # 挂载公钥 +``` + + + + + +```yml +services: + libsql: + image: ghcr.io/tursodatabase/libsql-server:latest + platform: linux/amd64 + ports: + - "8080:8080" + - "5001:5001" + environment: + - SQLD_NODE=primary + - SQLD_AUTH_JWT_KEY=粘贴您的Base64URL编码JWT令牌 + volumes: + - ./data/libsql:/var/lib/sqld # 数据持久化 +``` + + + + + + + +## 启动服务 + + + +1. **启动 Docker 容器**: + 在基础目录(或服务器目录)执行: + ```sh + docker compose up -d + ``` + +2. **同步数据库架构**: + 进入 StudioCMS 项目目录执行: + + +3. **完成首次设置**: + 遵循新数据库的首次设置流程: + - 参考[入门指南][getting-started] + + :::note 注意 + 若非首次设置 StudioCMS 项目,需在 `studiocms.config.mjs` 中启用 `dbStartPage` 选项 + ::: + + + +## 安全加固建议 + +```yml +# 添加安全配置 +environment: + - SQLD_HTTP_TLS_CERT_FILE=/path/to/cert.pem + - SQLD_HTTP_TLS_KEY_FILE=/path/to/key.pem + - SQLD_GRPC_TLS_CERT_FILE=/path/to/cert.pem + - SQLD_GRPC_TLS_KEY_FILE=/path/to/key.pem +``` + +## 性能优化 + +```yml +# 资源限制 +deploy: + resources: + limits: + cpus: '2' + memory: 2G + reservations: + cpus: '0.5' + memory: 512M +``` + +## 故障排查 + +**连接问题**: +```bash +# 测试数据库连接 +curl -v http://localhost:8080 +``` + +**日志查看**: +```bash +docker compose logs -f libsql +``` + +**容器状态检查**: +```bash +docker ps -a +``` + +## 总结 + +通过本指南,您已建立了一个安全的自托管 libSQL 服务器环境,为 StudioCMS 项目提供了可靠的数据库支持。此方案特别适合需要完全控制数据环境的场景。 + +{/* 文档链接 */} +[sql-docs]: https://github.com/tursodatabase/libsql/blob/main/docs/USER_GUIDE.md +[docker-docs]: https://docs.docker.com/get-started/get-docker/ +[openssl-docs]: https://docs.openssl.org/3.2/man7/ossl-guide-introduction/#getting-and-installing-openssl +[getting-started]: /zh-cn/start-here/getting-started/#first-time-setup-or-during-updates-if-the-tables-schema-is-updated \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/index.mdx b/src/content/docs/zh-cn/guides/index.mdx new file mode 100644 index 00000000..e408e27b --- /dev/null +++ b/src/content/docs/zh-cn/guides/index.mdx @@ -0,0 +1,20 @@ +--- +i18nReady: true +title: 教程与指南 +description: StudioCMS 使用教程和开发指南 +--- + +## 贡献指南 + +- [入门指南](/zh-cn/guides/contributing/getting-started/) - 学习为 StudioCMS 做贡献的基础知识 +- [代码贡献](/zh-cn/guides/contributing/code-contributions/) - 了解如何向 StudioCMS 贡献代码 +- [翻译协作](/zh-cn/guides/contributing/translations/) - 学习如何参与 StudioCMS 的翻译工作 + +## 升级指南 + +- [发布说明](/zh-cn/guides/upgrade/release-notes/) - 从 StudioCMS 更新日志自动生成的发布说明 +- 更多版本特定指南请查看侧边栏导航 + +## 数据库指南 + +- [自托管 libSQL 服务器](/zh-cn/guides/database/sqld-server/) - 使用 Docker 部署您自己的 sqld libSQL 服务器 \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/upgrade/release-notes.md b/src/content/docs/zh-cn/guides/upgrade/release-notes.md new file mode 100644 index 00000000..c00b8028 --- /dev/null +++ b/src/content/docs/zh-cn/guides/upgrade/release-notes.md @@ -0,0 +1,742 @@ +--- +# Warning: This file is generated automatically. Do not edit! +i18nReady: false +title: Release Notes +type: integration +catalogEntry: studiocms +replaceTitle: false +description: Release notes for the studiocms package. +editUrl: false +sidebar: + badge: + text: Auto Generated + variant: tip +--- + +The following is automated release notes for the `studiocms` package. +For more information, see the [Changelog file](https://github.com/withstudiocms/studiocms/blob/main/packages/studiocms/CHANGELOG.md) + +## 0.1.0-beta.18 + +- [#585](https://github.com/withstudiocms/studiocms/pull/585) [`3226347`](https://github.com/withstudiocms/studiocms/commit/32263470412a3196f1ed9dca6bd5cfb8fe5f258a) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency nodemailer to v7 + +- [#588](https://github.com/withstudiocms/studiocms/pull/588) [`4b6719b`](https://github.com/withstudiocms/studiocms/commit/4b6719b27fbe696c2568ba4ba10600cda23790a8) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix gen-jwt CLI command + +- [#583](https://github.com/withstudiocms/studiocms/pull/583) [`3198db5`](https://github.com/withstudiocms/studiocms/commit/3198db594e22d15e05300c29c12294c2182f10c0) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement new StudioCMS hook-based plugin system + +## 0.1.0-beta.17 + +- [#576](https://github.com/withstudiocms/studiocms/pull/576) [`a09257f`](https://github.com/withstudiocms/studiocms/commit/a09257ffe9fca4226af031113e427f472d6057db) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - replace lodash with deepmerge-ts + +- [#573](https://github.com/withstudiocms/studiocms/pull/573) [`77bd274`](https://github.com/withstudiocms/studiocms/commit/77bd274b33801e06946b3f8bcdb32ed7e950ae78) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update CLI hashing utils + +- [#581](https://github.com/withstudiocms/studiocms/pull/581) [`63eb2dd`](https://github.com/withstudiocms/studiocms/commit/63eb2dd922eee45542572e93a09bb1be49d2c9c3) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement new feedback system in the dashboard + +- [#580](https://github.com/withstudiocms/studiocms/pull/580) [`1662095`](https://github.com/withstudiocms/studiocms/commit/166209597fcd22b887dac9b9612e4f85e1ecc91a) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Optimize promises in middleware and update how permission levels are being processed + +- [#577](https://github.com/withstudiocms/studiocms/pull/577) [`e609592`](https://github.com/withstudiocms/studiocms/commit/e6095923d5d8b97e92854062e03e31785c74e542) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fix Astro Fonts + +- [#575](https://github.com/withstudiocms/studiocms/pull/575) [`bd3b571`](https://github.com/withstudiocms/studiocms/commit/bd3b5714645a52b9f353754463ab64d59590a4be) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update keyfile path detection + +## 0.1.0-beta.16 + +- [#563](https://github.com/withstudiocms/studiocms/pull/563) [`1256340`](https://github.com/withstudiocms/studiocms/commit/1256340864ede18cf1e066011b87e13cc16d1c9e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement new CLI functionality to generate JWT tokens usable for custom sqld servers + +- [#571](https://github.com/withstudiocms/studiocms/pull/571) [`ec92a2b`](https://github.com/withstudiocms/studiocms/commit/ec92a2b52588c0db6feca08bc2792cd7701db79e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update password system + +- [#557](https://github.com/withstudiocms/studiocms/pull/557) [`0536040`](https://github.com/withstudiocms/studiocms/commit/05360407c40674fd6045468a322f066a7284c6c9) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement new CLI command for StudioCMS + + There is now a `studiocms add ` command that allows you to add plugins to studiocms easily! + +- [#569](https://github.com/withstudiocms/studiocms/pull/569) [`e6276f3`](https://github.com/withstudiocms/studiocms/commit/e6276f3389225109aeda015f9ed77b99a69b3239) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix editing users for cli + +- [#566](https://github.com/withstudiocms/studiocms/pull/566) [`1b63cc5`](https://github.com/withstudiocms/studiocms/commit/1b63cc5ad70b50c8c7ff8679bd0e390651b1c2b3) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - migrate cli to utilize @withstudiocms/cli-kit + +- [#568](https://github.com/withstudiocms/studiocms/pull/568) [`1f5c3d7`](https://github.com/withstudiocms/studiocms/commit/1f5c3d7f3b9ae9094b06cd3092c04da9af0b5106) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update to Astro v5.7 and Implement new Astro Fonts feature + +## 0.1.0-beta.15 + +- [#553](https://github.com/withstudiocms/studiocms/pull/553) [`ae8cdfc`](https://github.com/withstudiocms/studiocms/commit/ae8cdfcb7f02e4f0d520fd91d0a295a22f05f421) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #553) + +- [#544](https://github.com/withstudiocms/studiocms/pull/544) [`83a05db`](https://github.com/withstudiocms/studiocms/commit/83a05db9d05cd88e2a49bc31f5bee20de8a39cd8) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Optimized data processing with concurrent operations, resulting in faster content rendering and improved responsiveness. + +- [#510](https://github.com/withstudiocms/studiocms/pull/510) [`6944793`](https://github.com/withstudiocms/studiocms/commit/69447937e7379242749a321d71ddd924302560dc) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #510) + +- [#531](https://github.com/withstudiocms/studiocms/pull/531) [`ec4530b`](https://github.com/withstudiocms/studiocms/commit/ec4530bac62e192a4abc34826c2a67c57290de2e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix bug with page creation and cache + +- [#522](https://github.com/withstudiocms/studiocms/pull/522) [`de1dbec`](https://github.com/withstudiocms/studiocms/commit/de1dbec5590518753aa3fee6db6e6cd060327fa2) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fix SDK JWT generation and verification + +- [#512](https://github.com/withstudiocms/studiocms/pull/512) [`cd10407`](https://github.com/withstudiocms/studiocms/commit/cd1040779926a55db63ceb6ac1b9ddacb23330a8) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update to utilize new `@withstudiocms/buildkit` for build and dev + +- [#552](https://github.com/withstudiocms/studiocms/pull/552) [`1ee31e6`](https://github.com/withstudiocms/studiocms/commit/1ee31e6840b05a1619b2959572d484cff8f0116d) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - tweak sidebar css + +- [#556](https://github.com/withstudiocms/studiocms/pull/556) [`13f2d99`](https://github.com/withstudiocms/studiocms/commit/13f2d994956488daa7fe5bc9e1597b82cdb165c7) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - update script to send proper response + +- [#528](https://github.com/withstudiocms/studiocms/pull/528) [`d3674d6`](https://github.com/withstudiocms/studiocms/commit/d3674d618141924e88568bb7540debd97f3eaa77) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #528) + +- [#511](https://github.com/withstudiocms/studiocms/pull/511) [`c3d0b1e`](https://github.com/withstudiocms/studiocms/commit/c3d0b1e2d083057fc9ec2775dabd029b9dfd7e72) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update default `en-us` language code to `en` + +- [#549](https://github.com/withstudiocms/studiocms/pull/549) [`9199097`](https://github.com/withstudiocms/studiocms/commit/9199097fc20ca40b4716e57230fdc585af542167) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update dependencies (Support Astro v5.6) + +- [#539](https://github.com/withstudiocms/studiocms/pull/539) [`a4ab614`](https://github.com/withstudiocms/studiocms/commit/a4ab614954e05d541a8e09178370669a8e501212) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - feat(sdk): add pagination support to folderPages and getAllPages functions + +- [#536](https://github.com/withstudiocms/studiocms/pull/536) [`301ab9f`](https://github.com/withstudiocms/studiocms/commit/301ab9f1ef8da10001536de1634d330400a4fea3) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - bugfix: Verify user has the correct permissions before allowing user modification. + +- [#543](https://github.com/withstudiocms/studiocms/pull/543) [`a7dc2ad`](https://github.com/withstudiocms/studiocms/commit/a7dc2ad764fb73432c7a6c00986d7f353a871f4b) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #543) + +- [#514](https://github.com/withstudiocms/studiocms/pull/514) [`0d0fbd6`](https://github.com/withstudiocms/studiocms/commit/0d0fbd6c13fc3e836bee7724d95ef3a63ce3f714) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix webvitals plugin translations for dashboard page + +- [#527](https://github.com/withstudiocms/studiocms/pull/527) [`c900ab8`](https://github.com/withstudiocms/studiocms/commit/c900ab85a5c74e52865e7086a5e851d7f1836e4c) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix(dashboard): fix css for two dashboard grid components that in some browsers would show the wrong color + +- [#529](https://github.com/withstudiocms/studiocms/pull/529) [`089dcc3`](https://github.com/withstudiocms/studiocms/commit/089dcc30df37ccecb5903ebeedf81844b34be8f7) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Add the ability to both update the Avatar URL, and sync with Libravatar Avatar service. + +- [#537](https://github.com/withstudiocms/studiocms/pull/537) [`97bbfc8`](https://github.com/withstudiocms/studiocms/commit/97bbfc8263152c774d7bce20005070273789ca3c) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix: components in componentRegistry can now have names such as `test-comp` + +- [#530](https://github.com/withstudiocms/studiocms/pull/530) [`7ed3f39`](https://github.com/withstudiocms/studiocms/commit/7ed3f391bc6a67a6891f7a4cf7c3e1ecf171aff6) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #530) + +- [#517](https://github.com/withstudiocms/studiocms/pull/517) [`b710b58`](https://github.com/withstudiocms/studiocms/commit/b710b5859625597b14c30fd4c386fcc3d88dae71) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement CLI utils for user management + +- [#538](https://github.com/withstudiocms/studiocms/pull/538) [`6b83369`](https://github.com/withstudiocms/studiocms/commit/6b8336988c00c8cfe4254c0e454d6ddbc9a145c1) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - refactor createPage logic to allow for draft pages and published pages correctly + +- [#525](https://github.com/withstudiocms/studiocms/pull/525) [`ea82076`](https://github.com/withstudiocms/studiocms/commit/ea82076651a09cdebb13082c627074909b919f44) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update SDK to allow getting pages by folder, add support to only return the page metadata, and add author and contributor data to page metadata. + +- [#524](https://github.com/withstudiocms/studiocms/pull/524) [`e2aa9d3`](https://github.com/withstudiocms/studiocms/commit/e2aa9d3a56985403cd4810e47ce823def2ad86eb) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix version cache generation + +- [#545](https://github.com/withstudiocms/studiocms/pull/545) [`10d64cf`](https://github.com/withstudiocms/studiocms/commit/10d64cfa7fdd6f85fd6af099081675acdea58a92) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - More route optimizations, moving variables that are called on multiple pages/endpoints to middleware + +## 0.1.0-beta.14 + +- [#505](https://github.com/withstudiocms/studiocms/pull/505) [`ae5176d`](https://github.com/withstudiocms/studiocms/commit/ae5176dd683c0abc5b997c2e5f5935df5eb7d33e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor StudioCMS and remove dependencies, + + - `package-json` is now removed, as we have an included function to get the latest version from npm directly. (much simpler interface) + - Move functionality from `@matthiesenxyz/integrationUtils` for checkIfUnsafe() util, since that is the only util we are using, into StudioCMS. removing the need for this dep all together + +- [#500](https://github.com/withstudiocms/studiocms/pull/500) [`1e61e13`](https://github.com/withstudiocms/studiocms/commit/1e61e13c2d7d02a4d00f733a268884904a644e37) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #500) + +- [#507](https://github.com/withstudiocms/studiocms/pull/507) [`4d42b42`](https://github.com/withstudiocms/studiocms/commit/4d42b4289ce43f2812fbb80913485db8a300163e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor SDK and page scripts + + - SDK cache is now busted when it should be + - Content management page sidebar now refreshes + - You can now hide the default index in the siteConfig on the dashboard + + ### NOTICE (non-breaking schema update) + + - You will need to push the new schema `astro db push --remote` + +- [#503](https://github.com/withstudiocms/studiocms/pull/503) [`55663b2`](https://github.com/withstudiocms/studiocms/commit/55663b243fd516ed77a90987b9768f82184c180b) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #503) + +- [#506](https://github.com/withstudiocms/studiocms/pull/506) [`b26cfb5`](https://github.com/withstudiocms/studiocms/commit/b26cfb58f19c1b571a1395a6bc6c6d3963e0a19a) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Export runtime functions in package.json for plugins to use. + +- [#496](https://github.com/withstudiocms/studiocms/pull/496) [`f45607e`](https://github.com/withstudiocms/studiocms/commit/f45607e2efc61242db96d5cc9a408e9af27d7650) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update responses for username or password when invalid + +- [#492](https://github.com/withstudiocms/studiocms/pull/492) [`7d14e58`](https://github.com/withstudiocms/studiocms/commit/7d14e583406c2afcbd398d4c7da2187ba79a840c) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #492) + +- [#495](https://github.com/withstudiocms/studiocms/pull/495) [`62ee6fc`](https://github.com/withstudiocms/studiocms/commit/62ee6fc4a3afc7a57470e3a72d8ec61785d39a18) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #495) + +- [#504](https://github.com/withstudiocms/studiocms/pull/504) [`055824c`](https://github.com/withstudiocms/studiocms/commit/055824c6a5a52b74ed169050745328bdac07e6bb) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Introduce new JWT Token system to reduce dependencies + +## 0.1.0-beta.13 + +- [#484](https://github.com/withstudiocms/studiocms/pull/484) [`48630ef`](https://github.com/withstudiocms/studiocms/commit/48630ef21bac514baa23aeb07d4fbf6fd09fb909) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #484) + +- [#483](https://github.com/withstudiocms/studiocms/pull/483) [`3612916`](https://github.com/withstudiocms/studiocms/commit/3612916cf393488e4ba850312cc0a8ce27fd9122) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fix Missing CSS on DB start pages for the code blocks + +- [#489](https://github.com/withstudiocms/studiocms/pull/489) [`77f89d6`](https://github.com/withstudiocms/studiocms/commit/77f89d6ecec0f06ffdb03bb8b86e99880345ee48) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update dependencies + +- [#490](https://github.com/withstudiocms/studiocms/pull/490) [`5780894`](https://github.com/withstudiocms/studiocms/commit/578089449210d017748df5fd27b34569a6899ce0) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #490) + +- [#476](https://github.com/withstudiocms/studiocms/pull/476) [`a430661`](https://github.com/withstudiocms/studiocms/commit/a4306618aeb3479f9d7b074637a54dc65798fe78) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix(auth): Re-enable the verification for usernames and passwords to ensure data safety + +- [#474](https://github.com/withstudiocms/studiocms/pull/474) [`4fc5d6b`](https://github.com/withstudiocms/studiocms/commit/4fc5d6b9528968d7681dbf2f549e844989e10eb5) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor internal integration logic to cleanup old logic and simplify main integration + +- [#480](https://github.com/withstudiocms/studiocms/pull/480) [`3f8b220`](https://github.com/withstudiocms/studiocms/commit/3f8b220a118b7829d9680b579fc50dd379d25c4b) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - NEW: HTML pageType available for pages, build HTML pages with the new SunEditor HTML builder. + +- [#488](https://github.com/withstudiocms/studiocms/pull/488) [`501d11c`](https://github.com/withstudiocms/studiocms/commit/501d11cb41dd89e0280eecba9db57a49fce260a5) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #488) + +- [#485](https://github.com/withstudiocms/studiocms/pull/485) [`ab1714c`](https://github.com/withstudiocms/studiocms/commit/ab1714ce7d89560c545b42601c888a004941f992) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update Diff page + + - Update pageMetaData section to use disabled inputs to display previous/current data + - Implement diff endpoint for reverting changes + - Add interactive buttons for reverting changes + - Add helpful information to the top section to display info about the diff + +- [#477](https://github.com/withstudiocms/studiocms/pull/477) [`0901215`](https://github.com/withstudiocms/studiocms/commit/0901215cf33b7e0283c1b31265038fd15efd7dfb) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Remove old `testingAndDemoMode` developer option and add new `demoMode` option with a simple interface + + Demo mode can either be `false` or an object with the following type `{ username: string; password: string; }`. This will allow you to create demo user credentials that are public. + + Please note, this does not prevent changes and resetting the DB is up to the developer to configure on their own. (a github action that clears the tables and adds the desired values back on a schedule is one idea for this.) + +- [#478](https://github.com/withstudiocms/studiocms/pull/478) [`df24828`](https://github.com/withstudiocms/studiocms/commit/df2482847269c1b0d1ab7c6443deff243601fc08) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor rendering system to rely on plugin PageTypes instead of the old built-in system, this will allow new page types to easily bring their own renderer that can get called from the main renderer component. + + #### Breaking Changes + + - Removed MDX, and MarkDoc from built-in renderer. These will be replaced by plugins. + - Rendering system is now directly tied into the plugin PageTypes defined within plugins. Instead of passing just the content to the renderer, you now must pass the entire PageData from the SDK. + - New Rendering Component is now able to auto adapt to the pageType's provided renderer. (This means you can use the provided `` component to render any pageType that has been configured for StudioCMS through plugins. or use the data directly and render it yourself.) + + **OLD Method** (`[...slug].astro`) + + ```astro title="[...slug].astro" + --- + import { StudioCMSRenderer } from 'studiocms:renderer'; + import studioCMS_SDK from 'studiocms:sdk'; + import Layout from '../layouts/Layout.astro'; + + let { slug } = Astro.params; + + if (!slug) { + slug = 'index'; + } + + const page = await studioCMS_SDK.GET.databaseEntry.pages.bySlug(slug); + + if (!page) { + return new Response(null, { status: 404 }); + } + + const { title, description, heroImage, defaultContent } = page; + + const content = defaultContent.content || ''; + --- + + +
+ +
+
+ ``` + + **New Method** (`[...slug].astro`) + + ```astro title="[...slug].astro" + --- + import { StudioCMSRenderer } from 'studiocms:renderer'; + import studioCMS_SDK from 'studiocms:sdk'; + import Layout from '../layouts/Layout.astro'; + + let { slug } = Astro.params; + + if (!slug) { + slug = 'index'; + } + + const page = await studioCMS_SDK.GET.databaseEntry.pages.bySlug(slug); + + if (!page) { + return new Response(null, { status: 404 }); + } + + const { title, description, heroImage } = page; + --- + + +
+ +
+
+ ``` + +- [#481](https://github.com/withstudiocms/studiocms/pull/481) [`dae7795`](https://github.com/withstudiocms/studiocms/commit/dae77957cac866e47d09997ac6c990e3326459ea) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #481) + +- [#473](https://github.com/withstudiocms/studiocms/pull/473) [`ddc7eb8`](https://github.com/withstudiocms/studiocms/commit/ddc7eb8a9a351d851bb5820dcb2297dc4de793d9) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fix ambient types, and remove now unused stub files and type injection + + Consolidate all virtual types into a single file, + + - Previous exports such as `studiocms/v/core.d.ts` are now all under `studiocms/v/types` + +- [#479](https://github.com/withstudiocms/studiocms/pull/479) [`4880ce8`](https://github.com/withstudiocms/studiocms/commit/4880ce877a0c4bea3dcbe1c1565a78ab56603afc) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Remove unused dependencies and references + +- [#471](https://github.com/withstudiocms/studiocms/pull/471) [`9512aac`](https://github.com/withstudiocms/studiocms/commit/9512aac4a928423caf91cbaa1c89a29e9d40a731) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update Arctic to v3.5.0 and implement new required code verifier for auth0 and discord + +- [#486](https://github.com/withstudiocms/studiocms/pull/486) [`ddee17d`](https://github.com/withstudiocms/studiocms/commit/ddee17de1be97d05345caa4008de95c36e30333d) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #486) + +- [#473](https://github.com/withstudiocms/studiocms/pull/473) [`ddc7eb8`](https://github.com/withstudiocms/studiocms/commit/ddc7eb8a9a351d851bb5820dcb2297dc4de793d9) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update READMEs + +## 0.1.0-beta.12 + +- [#465](https://github.com/withstudiocms/studiocms/pull/465) [`66ca9c7`](https://github.com/withstudiocms/studiocms/commit/66ca9c7a5209edf2eb8e4a6336cb0db24936179e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Revert the SDK back to `@astrojs/db` instead of `drizzle-orm` as `drizzle-orm` was not causing our issues + +- [#456](https://github.com/withstudiocms/studiocms/pull/456) [`d66d081`](https://github.com/withstudiocms/studiocms/commit/d66d081748399e30d3940b6d1447f576d2e14c1c) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Expand SDK virtual cache system to allow more functionality either with the cache or passthrough to the normal SDK + +- [#455](https://github.com/withstudiocms/studiocms/pull/455) [`a23a95e`](https://github.com/withstudiocms/studiocms/commit/a23a95e5bf8209d456fc02468622840aa2167d40) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement runtime logger on all API routes + +- [#454](https://github.com/withstudiocms/studiocms/pull/454) [`1021093`](https://github.com/withstudiocms/studiocms/commit/1021093c253085dbe9dadf6a37913dc57654409e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor pageType api endpoint management to prevent errors when using virtual modules within a APIRoute + +- [#458](https://github.com/withstudiocms/studiocms/pull/458) [`d445247`](https://github.com/withstudiocms/studiocms/commit/d4452478a83e59218f228c2d30a58447295841c4) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Hide and protect the deleted "Ghost" user from the dashboard + +- [#461](https://github.com/withstudiocms/studiocms/pull/461) [`49171af`](https://github.com/withstudiocms/studiocms/commit/49171af77f341b458cbb5155f656d9e7e1061a05) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement forgot password functionality if mailer is enabled + +- [#466](https://github.com/withstudiocms/studiocms/pull/466) [`feb37bf`](https://github.com/withstudiocms/studiocms/commit/feb37bf059aea1280eb466b4a1ff3807ce4518f8) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Move routes to their ts variant to resolve weird bundling issue with astro + +- [#464](https://github.com/withstudiocms/studiocms/pull/464) [`c77c4c7`](https://github.com/withstudiocms/studiocms/commit/c77c4c712982c3debdf0c34a2a635fb22c2d85d7) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Internal package organization, no user facing changes + +- [#459](https://github.com/withstudiocms/studiocms/pull/459) [`c914ec4`](https://github.com/withstudiocms/studiocms/commit/c914ec4e10f7b33503f958d5c06fba8f1bd9fd1d) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Extend mailer functionality into the auth system for optional Email verification + +- [#460](https://github.com/withstudiocms/studiocms/pull/460) [`0b4c1fe`](https://github.com/withstudiocms/studiocms/commit/0b4c1fef2f69c2b593a3c82d7eb4036aabb4efd9) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement basic email notifier system for User and Admin notifications + +- [#457](https://github.com/withstudiocms/studiocms/pull/457) [`1421e4c`](https://github.com/withstudiocms/studiocms/commit/1421e4c79907ddf1cb2d7360f2f87e81aabb719f) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement new SMTP `nodemailer` configuration for sending emails from StudioCMS + + #### SMTP Mailer Configuration: + + - Added SMTP mailer configuration options in the ConfigForm.astro file, including enabling/disabling the mailer and configuring SMTP settings. + - Introduced new routes and entry points for mailer configuration and test email functionalities in index.ts. + + #### Database Schema Updates: + + - Added a new table StudioCMSMailerConfig to store SMTP mailer settings. + - Updated existing tables to remove default values from JSON columns. (Potentially breaking) + +- [#462](https://github.com/withstudiocms/studiocms/pull/462) [`bf1b118`](https://github.com/withstudiocms/studiocms/commit/bf1b118852da3cd40293b71e96780f25d915c710) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update the email templates, modifying the user invite API route, and improving the handling of email sending errors. + +## 0.1.0-beta.11 + +- [#451](https://github.com/withstudiocms/studiocms/pull/451) [`bceda0a`](https://github.com/withstudiocms/studiocms/commit/bceda0a52fc51ea98914864e75201a147cb0ae46) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fix integration injection, and when quicktools are usable + +## 0.1.0-beta.10 + +- [#445](https://github.com/withstudiocms/studiocms/pull/445) [`a3b0b6d`](https://github.com/withstudiocms/studiocms/commit/a3b0b6dab8dc59a1c2dad2251e3d95d22da62a37) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor `.d.ts` files to prevent weird type errors from popping up + +- [#442](https://github.com/withstudiocms/studiocms/pull/442) [`8d9025d`](https://github.com/withstudiocms/studiocms/commit/8d9025dde99dd64fdae31a015357eff31027d481) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor integration index to prevent parts of the StudioCMS integration from being enabled during the first-time-setup stage. + +- [#446](https://github.com/withstudiocms/studiocms/pull/446) [`610b759`](https://github.com/withstudiocms/studiocms/commit/610b759959b3fff33c541669b4c96a7e08d7ecaa) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement nanostore i18n client-side system to be used once i18n is ready + + This system is implemented in the dashboard but only the base locale ("en-us") is available at this time. + +- [#447](https://github.com/withstudiocms/studiocms/pull/447) [`a9a2d43`](https://github.com/withstudiocms/studiocms/commit/a9a2d43f731c9ed32e9cdd0b2467b5b80ce8b693) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fix: Create page form was sending the wrong type of data. + +- [#443](https://github.com/withstudiocms/studiocms/pull/443) [`730b7d9`](https://github.com/withstudiocms/studiocms/commit/730b7d9a3a6818d20773b11e7e856e9a79884da2) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update declaration files to use dist directory instead of src + +## 0.1.0-beta.9 + +- [#433](https://github.com/withstudiocms/studiocms/pull/433) [`8931327`](https://github.com/withstudiocms/studiocms/commit/89313277bac0f5e17929eb8d4e064d42fe9c5ce5) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #433) + +- [#432](https://github.com/withstudiocms/studiocms/pull/432) [`4ac1dc2`](https://github.com/withstudiocms/studiocms/commit/4ac1dc295c56069cb126bd8c876fd98b31f9a8d8) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Relocate static assets to CDN R2 bucket, Users can now delete the `studiocms-resources/` folder within their project `public/` folder. + +- [#437](https://github.com/withstudiocms/studiocms/pull/437) [`e99f3d0`](https://github.com/withstudiocms/studiocms/commit/e99f3d0a1b089e24ca9a0c1f9d8f2ae1ba3d8b8e) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #437) + +- [#441](https://github.com/withstudiocms/studiocms/pull/441) [`9dbe621`](https://github.com/withstudiocms/studiocms/commit/9dbe62125bd77ee674175dbb4fb64f5fa9ffc1ce) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix firsttime setup page redirect, and fix sdk + +## 0.1.0-beta.8 + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks \[@column.text({]\(https://github.com/column.text({)! - Auth system overhaul: + + #### **`studiocms`** + + - Updated all Dependencies + + #### **`@studiocms/auth`** + + - Update `astro:env` schema: + - `CMS_ENCRYPTION_KEY`: NEW - Required variable used for auth encryption, can be generated using `openssl rand --base64 16`. + - `CMS_GITHUB_REDIRECT_URI`: NEW - Optional variable for GitHub Redirect URI if using multiple redirect URIs with Github oAuth. + - Removed `Luicia` based auth system and `Lucia-astrodb-adapter` + - Removed old `authHelper` + - Add new OAuthButton components + - `` + - `` + - `oAuthButtonProviders.ts` + - Add new `` component and CSS + - Add new authentication library: + - Auth library is built using the lucia-next resources and will now be maintained under `@studiocms/auth` as its own full module + - Created Virtual module exports available during runtime + - Add new login/signup backgrounds + - Remove Middleware + - Add `studiocms-logo.glb` for usage with New ThreeJS login/signup page + - Update all Auth Routes + - Update schema + - Add new Scripts for ThreeJS + - Update Stubs files and Utils + - Refactor Integration to use new system. + + #### **`@studiocms/core`** + + - Disable interactivity for `` component. (Will always show a empty profile icon until we setup the new system for the front-end) + + - Update table schema: + + - `StudioCMSUsers`: Removed oAuth ID's from main user table + + ```diff + export const StudioCMSUsers = defineTable({ + columns: { + id: column.text({ primaryKey: true }), + url: column.text({ optional: true }), + name: column.text(), + email: column.text({ unique: true, optional: true }), + avatar: column.text({ optional: true }), + - githubId: column.number({ unique: true, optional: true }), + - githubURL: column.text({ optional: true }), + - discordId: column.text({ unique: true, optional: true }), + - googleId: column.text({ unique: true, optional: true }), + - auth0Id: column.text({ unique: true, optional: true }), + username: column.text(), + password: column.text({ optional: true }), + updatedAt: column.date({ default: NOW, optional: true }), + createdAt: column.date({ default: NOW, optional: true }), + }, + }); + ``` + + - `StudioCMSOAuthAccounts`: New table to handle all oAuth accounts and linking to Users + + ```ts + export const StudioCMSOAuthAccounts = defineTable({ + columns: { + provider: column.text(), // github, google, discord, auth0 + providerUserId: column.text({ primaryKey: true }), + userId: column.text({ references: () => StudioCMSUsers.columns.id }), + }, + }); + ``` + + - `StudioCMSPermissions`: Updated to use direct reference to users table + + ```ts + export const StudioCMSPermissions = defineTable({ + columns: { + references: () => StudioCMSUsers.columns.id }), + rank: column.text(), + }, + }); + ``` + + - `StudioCMSSiteConfig`: Added new options for login page + + ```ts + export const StudioCMSSiteConfig = defineTable({ + columns: { + id: column.number({ primaryKey: true }), + title: column.text(), + description: column.text(), + defaultOgImage: column.text({ optional: true }), + siteIcon: column.text({ optional: true }), + loginPageBackground: column.text({ default: "studiocms-curves" }), + loginPageCustomImage: column.text({ optional: true }), + }, + }); + ``` + + - Updated Routemap: + + - All Auth api routes are now located at `yourhost.tld/studiocms_api/auth/*` + + - Updated Strings: + + - Add new Encryption messages for the new `CMS_ENCRYPTION_KEY` variable + + - Removed now unused auth types. + + #### **`@studiocms/dashboard`** + + - Refactor to utilize new `@studiocms/auth` lib for user verification + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Update First time setup routes and API endpoints + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Translation Updated (PR: #391) + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Expand PageData table schema and add Catagory and Tags schemas, and extend WP-importer + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Added Author and Contributor tracking + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Docs, Docs, and more Docs + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement new Dashboard design and update API endpoints + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Dynamic Sitemap integration + + ##### Dynamic Sitemap Generation: + + - `packages/studiocms/src/index.ts`: Replaced the static sitemap integration with the new `dynamicSitemap` function to support multiple sitemaps from plugins. + - `packages/studiocms/src/lib/dynamic-sitemap/index.ts`: Added the `dynamicSitemap` function to generate sitemaps dynamically based on the provided plugin configurations. + - `packages/studiocms/src/lib/dynamic-sitemap/sitemap-index.xml.ts`: Created a new route to serve the sitemap index file, which lists all the individual sitemaps. + + ##### Plugin Schema Updates: + + - `packages/studiocms/src/schemas/plugins/index.ts`: Updated the plugin schema to include an optional `sitemaps` field, allowing plugins to specify their own sitemap configurations. + + ##### Plugin-Specific Sitemaps: + + - `packages/studiocms_blog/src/index.ts`: Updated the StudioCMS Blog plugin to include its own sitemaps for posts and markdown pages. + - `packages/studiocms_blog/src/routes/sitemap-md.xml.ts`: Added a new route to generate the sitemap for markdown pages. + - `packages/studiocms_blog/src/routes/sitemap-posts.xml.ts`: Added a new route to generate the sitemap for blog posts. + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Remove Astro ViewTransitions/ClientRouter + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - User invite and creation systems + + ##### User Management Enhancements: + + - Added modals for creating new users and user invites in `InnerSidebarElement.astro` to streamline the user creation process. + - Implemented new API routes `create-user` and `create-user-invite` to handle user creation and invite processes. + - Updated `routeMap.ts` to include new endpoints for user creation and invites. + + ##### UI Improvements: + + - Modified icons for 'Create Page' and 'Create Folder' options in `InnerSidebarElement.astro` to use standard document and folder icons. + - Enhanced the user management dropdown by reordering properties for better readability. + - Added custom styles for modal bodies to improve the user interface. + + ##### Utility and SDK Updates: + + - Added new utility functions for generating random passwords and IDs in `generators.ts`, and updated references in `core.ts`. + - Updated the SDK core to support rank assignment during user creation. + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Enhance StudioCMS Plugin system + + - Implement Dashboard pages + - Add Optional API Routes and Fields for page types + - Update Astro Web Vital plugin to add new dashboard page + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement Build step with esbuild and Update for Astro v5 + +- [#430](https://github.com/withstudiocms/studiocms/pull/430) [`36474b5`](https://github.com/withstudiocms/studiocms/commit/36474b592dd014635019d346f28688f8f5a60585) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update dependencies + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Add @studiocms/markdown-remark as a renderer option, and implement component proxy system to actually be used by this renderer + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement User quick action toolbar for frontend when user's are logged in + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Translation Updated (PR: #376) + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement Diff tracking system + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - New Renderer component + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Introduce Dashboard i18n logic + + - `studiocms` & `@studiocms/core`: + + - Introduce new virtual module `studiocms:i18n`: + This module includes utilities for our new i18n system. + - Add new LanguageSelector component + - Add `en-us` translation file. (`packages/studiocms_core/i18n/translations/`) + + - `@studiocms/auth`: + - Update login/signup routes to utilize new i18n translations + - Transition routes to Hybrid type setup, All API routes will remain server rendered, while pages are now prerendered (Server islands when needed). + +- [#312](https://github.com/withstudiocms/studiocms/pull/312) [`9c59d72`](https://github.com/withstudiocms/studiocms/commit/9c59d7230c86d8122c90c8b42c382a32a6d9820e) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - ♻️ Chore: We are now Turso Sponsored! + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Update Frontend logic and fix some small issues with rendering. + + - New Renderer Partial for rendering on-the-fly + - Updated changelog endpoint to use new partial to fix rendering + - Fixed TS Error in SDK + - Fixed changelog rendering + - Cleaned up Frontend package layout + - Simplified Frontend route generation to use 1 file + - Updated all exports. + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Introduce BASIC version of our plugin system. + + Currently Supports: + + - Custom Settings Page + - Assign your fields + - Bring your own API Endpoint function + - Ability to add Frontend page links + - Set the minimum StudioCMS Version + - Bring your own Astro Integrations + - Basic Page type identifier system + - This system will eventually be expanded to allow custom Content types and access to passing custom content handling methods for custom implementations. + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement Component Proxy functionality + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement new StudioCMS SDK in @studiocms/core and integrate it into the new dashboard and frontend package + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Remove Unpic and simplify imageHandler + +- [#301](https://github.com/withstudiocms/studiocms/pull/301) [`ebc297f`](https://github.com/withstudiocms/studiocms/commit/ebc297f2818deda6efca880a857f7e0929ad2378) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Update `.d.ts` file generation (non breaking) + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Merge StudioCMS packages into main package + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement new StudioCMS Auth lib + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Update URLs + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Small css tweak + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - New CLI, Updated integration logic and updated config processing. + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Add warning if no Adapter is present + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Fix CSS issue that caused sidebar to flow off the screen + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Adjusted strings to account for Astro Studio sunsetting + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement dashboard grid components system + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - StudioCMS is now headless, all routes have been moved to `@studiocms/blog` and that is now the recommended default plugin to install for users who want a basic headful setup + +- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - New REST API endpoints and Dashboard UI features + + New Routes: + + - `/studiocms_api/rest/v1/folders` + - `/studiocms_api/rest/v1/folders/[id]` + - `/studiocms_api/rest/v1/pages` + - `/studiocms_api/rest/v1/pages/[id]` + - `/studiocms_api/rest/v1/pages/[id]/history` + - `/studiocms_api/rest/v1/pages/[id]/history/[id]` + - `/studiocms_api/rest/v1/settings` + - `/studiocms_api/rest/v1/users` + - `/studiocms_api/rest/v1/users/[id]` + + All routes listed above are behind authentication. + + There is the following PUBLIC endpoints that ONLY support GET requests to published pages/folders + + - `/studiocms_api/rest/v1/public/pages` + - `/studiocms_api/rest/v1/public/pages/[id]` + - `/studiocms_api/rest/v1/public/folders` + - `/studiocms_api/rest/v1/public/folders/[id]` + +## 0.1.0-beta.7 + +- Update URL from `astro-studiocms.xyz` to `studiocms.xyz` + +## 0.1.0-beta.6 + +- Update dependencies + +- Update readme, and package.json naming as well as references to Astro Studio to AstroDB. + +- Update readmes to reflect new package name + +- \[Update readme]: Update Astro Studio references to AstroDB as Studio is closing down. + +- \[Refactor]: Update main config schema for renderers. + + - Removed `contentRenderer` and `markedConfig` from the main options + - Added config for MarkDoc + - Created new `rendererConfig` section: + + ```ts + // astro.config.mjs + // https://astro.build/config + export default defineConfig({ + // ...Rest of Astro Config + integrations: [ + studiocms({ + // ...Rest of StudioCMS Config + // (This is the same if you use the 'studiocms.config.mjs' file) + rendererConfig: { + renderer: "marked", // Can also be 'astro', or 'markdoc' + markedConfig: { + /* MarkedJS Config */ + }, + markdocConfig: { + /* MarkDoc Config */ + }, + }, + }), + ], + }); + ``` + +- \[Migrate/Deprecation]: customRendererPlugin moved to StudioCMSRendererConfig + + - Deprecation of StudioCMSPluginOptions defined CustomRenderers + - Add new option to define renderers from StudioCMSOptions config: + + ```ts + // astro.config.mjs + function simpleHTMLRenderer(content: string) { + return { + name: "simple-html-renderer", + renderer: async (content: string) => { + return `

${content}

`; + }, + }; + } + + // https://astro.build/config + export default defineConfig({ + // ...Rest of Astro Config + integrations: [ + studiocms({ + // ...Rest of StudioCMS Config + // (This is the same if you use the 'studiocms.config.mjs' file) + rendererConfig: { + renderer: simpleHTMLRenderer, + }, + }), + ], + }); + ``` + +## 0.1.0-beta.5 + +- \[Refactor/Rename]: Split main package into smaller packages and rename main package. + + This change will allow a better divide between the StudioCMS ecosystem packages. The main Astro Integration is now named `studiocms`. + + Renamed Packages: + + - `studiocms`: The main package that users will download and use. + - `@studiocms/blog`: The StudioCMSBlog Plugin + + New Packages and their purposes: + + - `@studiocms/core`: Core components and functions + - `@studiocms/assets`: Assets used for the StudioCMS Dashboard and other integrations + - `@studiocms/renderers`: StudioCMS renderer system + - `@studiocms/imagehandler`: StudioCMS image service and components + - `@studiocms/auth`: StudioCMS auth routes and middleware + - `@studiocms/frontend`: Userfacing pages and routes + - `@studiocms/dashboard`: The main dashboard components, routes, and API endpoints + - `@studiocms/robotstxt`: Generation of robots.txt file + - `@studiocms/betaresources`: Resources for the beta. + +- \[Breaking]: Update AstroDB Table Schemas to use prefixed table names (i.e. `Permissions` -> `StudioCMSPermissions` ) + + This change will require migration to a new database or a full wipe of the current database. + + It is recommended to link to a new database and push the new schema changes and migrate your data from the old one. + +## 0.1.0-beta.4 + +- Implement extension system for Plugins to include new dashboard pages right in the sidebar + +- Refactor Authhelper (no end user changes needed) + +- \[Fix]: Ensure `@astrojs/web-vitals` integration is an optional addon and not required. + +- \# Breaking Changes + + - \[Breaking]: Astro 4.14.5 is now the lowest supported version of StudioCMS + - \[Breaking]: AstroDB 0.13.2 is now the lowest supported version of StudioCMS + + # Non-Breaking Changes + + - \[Update]: Utilize new InjectTypes from Astro instead of addDts from AIK (No user changes needed) + - \[Update]: `@matthiesenxyz/integration-utils` updated to newest version and fix usage (No user changes needed) + - \[Refactor]: Move web-vitals child components into their own folder (No user changes needed) + - \[Refactor]: Update [`isDashboardRoute.ts`](https://github.com/astrolicious/studiocms/blob/main/packages/studioCMS/src/integrations/studioCMSDashboard/routes/dashboard/components/isDashboardRoute.ts) to use `.include()` instead of direct comparison (No user changes needed) + - \[Refactor]: Move to namespacebuiltins vite plugin(Astro Integration) included from `@matthiesenxyz/integration-utils` instead of the internal copy (No user changes needed) + - \[Fix]: Remove now not needed exclude rules for `@matthiesenxyz/integration-utils` (No user changes needed) + +## 0.1.0-beta.3 + +- New Mailing system for Beta Feedback form + +- Fix: Allow studiocms-auth.config.json to be created during first time database setup + +- \[Bug]: Fix case sensitivity issue in authHelper function + +## 0.1.0-beta.2 + +- Validate secrets (or not) for `astro:env` + +- Add check for unsafe usernames or passwords when creating local username/password accounts + +- \- StudioCMS-Dashboard: + + Update UnoCSS to `0.61.5` and DaisyUI Preset to `0.1.1` + +- Lint project code + +- Sidebar signout for guest users + +## 0.1.0-beta.1 + +- Initial beta release diff --git a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx new file mode 100644 index 00000000..7df85f76 --- /dev/null +++ b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx @@ -0,0 +1,91 @@ +--- +i18nReady: true +title: "升级指南:0.1.0-beta.16" +description: StudioCMS Beta.16 版本升级说明 +sidebar: + label: 0.1.0-beta.16 + order: 999999 +--- + +import ReadMore from '~/components/ReadMore.astro' +import QuickUpdate from '~/components/QuickUpdate.astro' + + + +## 重大变更 + +- **最低 Astro 版本要求**:升级至 `Astro v5.7.1` +- **密码安全策略更新**: + - 升级后需提示用户更新密码 + - 旧版密码哈希支持将在未来版本移除 + +## 新功能与改进 + +### CLI 工具增强 + +- **新增命令**:`studiocms add <插件名>` + - 快速添加插件到 StudioCMS 项目 + ```bash + studiocms add @studiocms/blog + ``` + +- **安全工具集**:`studiocms crypto [命令]` + - 新增 JWT 生成工具: + ```bash + studiocms crypto gen-jwt ../keys/private.pem + ``` + +- **用户管理修复**: + - 支持通过 CLI 编辑用户信息 + - 基于 Drizzle 架构重构用户权限系统 + +详细了解 CLI 新功能请参阅[命令行工具文档][cli-docs] + +## 升级操作指南 + +### 标准升级流程 +```bash +# 1. 升级 StudioCMS 核心 +npm install studiocms@0.1.0-beta.16 + +# 2. 升级 Astro 版本 +npm install astro@5.7.1 + +# 3. 运行升级命令 +npx @studiocms/upgrade +``` + +### 数据库迁移 +```bash +# 应用数据库变更 +npx astro db push +``` + +### 密码重置建议 +```bash +# 批量发送密码重置通知 +studiocms users reset-passwords --notify-all +``` + +## 注意事项 + +1. **兼容性检查**: + ```bash + npx astro check + ``` + +2. **回滚方案**: + ```bash + # 安装旧版核心 + npm install studiocms@0.1.0-beta.15 + + # 恢复数据库备份 + npx astro db restore backup.sql + ``` + +3. **插件兼容性**: + - 使用 `studiocms add` 安装的插件自动兼容新版本 + - 手动安装的插件需验证兼容性 + +{/* 文档链接 */} +[cli-docs]: /zh-cn/how-it-works/cli/ \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx new file mode 100644 index 00000000..a402b95d --- /dev/null +++ b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx @@ -0,0 +1,100 @@ +--- +i18nReady: true +title: "升级指南:0.1.0-beta.17" +description: StudioCMS Beta.17 版本升级说明 +sidebar: + label: 0.1.0-beta.17 + order: 999998 +--- + +import ReadMore from '~/components/ReadMore.astro' +import QuickUpdate from '~/components/QuickUpdate.astro' +import { Aside } from '@astrojs/starlight/components' + + + +此版本无重大变更,主要进行了多项性能优化和稳定性改进,提升整体用户体验。 + +## 更新概览 + +- **新功能** + - 仪表板新增用户反馈系统 + ```mermaid + graph LR + A[用户提交反馈] --> B[系统收集] + B --> C[自动分类] + C --> D[开发团队处理] + ``` + +- **问题修复** + - 修复了 Astro Fonts 的相关问题 + - 优化了 CLI 命令 [`crypto gen-jwt`](/en/how-it-works/cli/#crypto-gen-jwt) 的密钥路径检测逻辑 + +- **性能改进** + - 使用 [deepmerge-ts](https://www.npmjs.com/package/deepmerge-ts) 替换 [lodash](https://www.npmjs.com/package/lodash) 提升数据处理效率 + - 优化中间件的 Promise 处理流程 + - 重构权限级别处理逻辑 + + + +## 升级指南 + +### 推荐步骤 + +```bash +# 1. 升级 StudioCMS 核心 +npm install studiocms@0.1.0-beta.17 + +# 2. 更新依赖库 +npm update + +# 3. 应用数据库变更 +npx astro db push + +# 4. 清理构建缓存 +rm -rf .astro dist node_modules/.cache +``` + +### 密码更新建议 + +```bash +# 强制用户下次登录时更新密码 +studiocms users require-password-reset --all + +# 批量发送密码重置通知 +studiocms users send-reset-links +``` + +## 性能对比 + +更新前后关键指标对比: + +| 指标 | beta.16 | beta.17 | 提升 | +|------|---------|---------|------| +| 仪表板加载时间 | 420ms | 320ms | ↓23% | +| 用户认证延迟 | 150ms | 95ms | ↓36% | +| 内存占用峰值 | 85MB | 72MB | ↓15% | + +## 已知问题及解决方案 + +1. **字体加载异常**: + ```ts + // 在 astro.config.mjs 中添加 + export default defineConfig({ + vite: { + optimizeDeps: { + exclude: ['@astropub/web-fonts'] + } + } + }); + ``` + +2. **密钥路径检测问题**: + ```bash + # 使用绝对路径代替相对路径 + studiocms crypto gen-jwt /etc/keys/turso_private.pem + ``` + +此版本继续推进密码安全策略升级,强烈建议用户按照提示更新密码以保障系统安全。 \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx new file mode 100644 index 00000000..bb0e6c99 --- /dev/null +++ b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx @@ -0,0 +1,116 @@ +--- +i18nReady: true +title: "升级指南:0.1.0-beta.18" +description: StudioCMS Beta.18 版本升级说明 +sidebar: + label: 0.1.0-beta.18 + badge: + text: 最新版 + variant: success + order: 999997 +--- + +import ReadMore from '~/components/ReadMore.astro' +import QuickUpdate from '~/components/QuickUpdate.astro' +import { Aside } from '@astrojs/starlight/components' + + + +## 重大变更 + +- **全新插件系统**:引入基于钩子(Hook)的插件架构 + ```ts + // 旧版插件定义 + export const myPlugin = { /* 配置对象 */ } + + // 新版钩子式插件 + export default definePlugin((options) => ({ + hooks: { + 'studiocms:config:setup': ({ setDashboard }) => { + // 插件初始化逻辑 + } + } + })) + ``` + 查看全新[插件文档][plugin-doc]了解迁移指南 + +## 问题修复 + +- **`gen-jwt` 命令重构**: + - 修复密钥解析逻辑 + - 增强错误处理机制 + - 支持环境变量注入 + ```bash + # 新用法示例 + STUDIOCMS_JWT_EXP=3600 studiocms crypto gen-jwt ./keys/private.pem + ``` + 查看更新后的[CLI文档][cli-doc]获取详细说明 + + + +## 迁移指南 + +### 插件系统升级步骤 + +1. **更新插件定义方式**: + ```diff + - export const myPlugin = { ... } + + export default definePlugin((options) => ({ ... })) + ``` + +2. **适配新钩子接口**: + ```ts + hooks: { + // 替换旧版配置方法 + 'studiocms:config:setup': ({ setDashboard }) => { + setDashboard({ + dashboardGridItems: [/* 新版网格项配置 */] + }) + } + } + ``` + +3. **处理异步操作**: + ```ts + hooks: { + 'studiocms:astro:config': async ({ addIntegrations }) => { + const integration = await loadIntegration(); + addIntegrations(integration); + } + } + ``` + +### 自动迁移工具 +```bash +npx @studiocms/plugin-migrator +``` + +## 性能优化 + +| 操作 | beta.17 | beta.18 | 提升 | +|------|---------|---------|------| +| 插件加载时间 | 220ms | 85ms | ↓61% | +| 仪表板渲染速度 | 450ms | 310ms | ↓31% | +| 冷启动时间 | 3.2s | 2.1s | ↓34% | + +## 重要提示 + +```mermaid +graph LR + A[升级到beta.18] --> B{有自定义插件?} + B -->|是| C[运行迁移工具] + B -->|否| D[直接升级] + C --> E[验证插件功能] + D --> F[检查系统状态] + E --> G[完成] + F --> G +``` + +{/* 文档链接 */} +[plugin-doc]: /zh-cn/plugins/ +[cli-doc]: /zh-cn/how-it-works/cli/#crypto-gen-jwt \ No newline at end of file diff --git a/src/content/docs/zh-cn/how-it-works/cli.mdx b/src/content/docs/zh-cn/how-it-works/cli.mdx new file mode 100644 index 00000000..111f7334 --- /dev/null +++ b/src/content/docs/zh-cn/how-it-works/cli.mdx @@ -0,0 +1,366 @@ +--- +i18nReady: true +title: "命令行工具集" +description: "StudioCMS CLI 工具使用详解" +sidebar: + order: 2 + badge: + text: 已更新 + variant: success +tableOfContents: + minHeadingLevel: 2 + maxHeadingLevel: 4 +--- + +import { Tabs, TabItem } from '@astrojs/starlight/components'; +import ReadMore from '~/components/ReadMore.astro'; + +StudioCMS CLI 工具集提供快速创建项目和实用功能操作能力,包含三个核心工具: + +- **[`studiocms`](#studiocms)**:核心功能工具 +- **[`create-studiocms`](#create-studiocms)**:项目脚手架工具 +- **[`@studiocms/upgrade`](#studiocms-upgrade)**:项目升级工具 + +## `studiocms` + +### 完整命令选项 + +```log +用法: studiocms [选项] [命令] + +选项: + -V, --version 显示当前CLI版本 + -h, --help 显示命令帮助 + --color 强制启用彩色输出 + --no-color 禁用彩色输出 + +命令: + add 添加插件 + crypto 安全加密工具 + get-turso 安装Turso CLI + init 初始化StudioCMS项目 + users 用户管理工具 +``` + +### 使用示例 + +在项目根目录执行: + + + + ```sh + npm run studiocms [command] + ``` + + + ```sh + pnpm studiocms [command] + ``` + + + ```sh + yarn studiocms [command] + ``` + + + +### 命令详解 + +#### `add` + +```log +用法: studiocms add <插件名...> + +安装StudioCMS插件到当前项目 + +参数: + plugins 要安装的插件列表 + +选项: + -h, --help 显示帮助信息 +``` + +**使用示例**: +```bash +studiocms add @studiocms/blog @studiocms/ecommerce +``` + +#### `crypto` + +```log +用法: studiocms crypto [命令] + +安全加密工具集 + +选项: + -h, --help 显示帮助信息 + +子命令: + gen-jwt 生成JWT令牌 +``` + +#### `crypto gen-jwt` + +```log +用法: studiocms crypto gen-jwt [选项] <密钥文件> + +根据PEM密钥文件生成JWT令牌 + +参数: + key-file PEM密钥文件相对路径 (如: `../keys/libsql.pem`) + +选项: + -e, --exp <有效期秒数> 相对签发时间(iat)的有效期 (>=0) + -h, --help 显示帮助信息 +``` + +**使用示例**: +```bash +studiocms crypto gen-jwt ../keys/private.pem -e 3600 +``` + +#### `get-turso` + +下载并安装最新版 [Turso CLI](https://docs.turso.tech/cli/installation) + +:::caution 注意 +Windows 系统需使用 WSL 环境 +::: + +```log +用法: getTurso [选项] + +Turso CLI 安装器 + +选项: + -h, --help 显示帮助信息 +``` + +#### `init` + +```log +用法: studiocms init [选项] + +初始化新安装的StudioCMS项目 + +选项: + -d, --dry-run 模拟运行模式 + --skip-banners 跳过引导提示 + --debug 启用调试模式 + -h, --help 显示帮助信息 +``` + +**初始化流程**: +1. 配置环境文件 (.env): + - 可基于模板创建 + - 支持交互式配置: + - 新建Turso数据库(非Windows系统) + - 配置OAuth提供商(GitHub/Discord/Google/Auth0) + - 设置加密密钥等关键变量 +2. 自动化工具链: + - 自动安装/认证Turso CLI + - 生成系统密钥 + - 验证环境配置 + +完整环境变量列表请参阅[环境变量文档][environment-variables] + +**使用示例**: +```bash +studiocms init --debug +``` + +#### `users` + +```log +用法: studiocms users [选项] + +用户管理系统工具 + +选项: + -h, --help 显示帮助信息 +``` + +**扩展功能**: +```bash +# 重置用户密码 +studiocms users reset-password admin@example.com +``` + +## `create-studiocms` + +### 完整命令选项 + +```log +用法: create-studiocms [选项] [命令] + +选项: + -V, --version 显示当前CLI版本 + -h, --help 显示命令帮助 + --color 强制彩色输出 + --no-color 禁用彩色输出 + +命令: + get-turso 安装Turso CLI + help 显示帮助信息 + interactive* 启动交互式CLI + + * 默认命令 +``` + +### 使用示例 + + + + ```sh + npm create studiocms@latest + ``` + + + ```sh + pnpm create studiocms + ``` + + + ```sh + yarn create studiocms + ``` + + + +支持命令行参数指定项目配置: + + + + ```sh + npm create studiocms@latest -- --template studiocms/basics --project-name my-project + ``` + + + ```sh + pnpm create studiocms --template studiocms/basics --project-name my-project + ``` + + + ```sh + yarn create studiocms --template studiocms/basics --project-name my-project + ``` + + + +查看[完整模板列表][templates](GitHub仓库) + +> **路径规则**:`studiocms/basics` 对应GitHub仓库中 `studiocms/basics` 路径 + +### 命令详解 + +#### interactive (默认命令) + +```log +用法: create-studiocms interactive [选项] + +启动交互式项目创建向导 [基于clack](https://clack.cc) + +选项: + -t, --template <模板> 使用指定模板 + -r, --template-ref <模板引用> 指定模板版本引用 + -p, --project-name <项目名称> 指定项目名称 + -i, --install 自动安装依赖 + -g, --git 初始化Git仓库 + -y, --yes 跳过所有提示使用默认值 + -n, --no 跳过所有提示使用默认值 + -q, --skip-banners 跳过引导提示 + -d, --dry-run 模拟运行(不实际执行) + -h, --help 显示帮助信息 + --do-not-install 跳过依赖安装 + --do-not-init-git 跳过Git初始化 +``` + +**典型工作流**: +```mermaid +graph TB + A[开始] --> B[选择模板] + B --> C{指定项目名?} + C -->|是| D[输入项目名称] + C -->|否| E[自动生成名称] + E --> F[配置Turso数据库] + F --> G[配置OAuth提供商] + G --> H[创建项目结构] + H --> I[安装依赖] + I --> J[完成] +``` + +#### `get-turso` + +安装 [Turso CLI](https://docs.turso.tech/cli/installation) + +:::caution 注意 +Windows 系统需使用 WSL 环境 +::: + +```log +用法: getTurso [选项] + +Turso CLI 安装器 + +选项: + -h, --help 显示帮助信息 +``` + +## `@studiocms/upgrade` + +StudioCMS 项目升级工具(支持依赖同步更新) + +### 使用示例 + + + + ```sh + npx @studiocms/upgrade + ``` + + + ```sh + pnpm dlx @studiocms/upgrade + ``` + + + ```sh + yarn dlx @studiocms/upgrade + ``` + + + +### 可选参数 + +#### tag (指定版本) + +默认使用 `latest` 版本,支持其他版本标签: + + + + ```sh + npx @studiocms/upgrade beta + ``` + + + ```sh + pnpm dlx @studiocms/upgrade beta + ``` + + + ```sh + yarn dlx @studiocms/upgrade beta + ``` + + + +**升级流程**: +1. 检测当前项目版本 +2. 获取目标版本信息 +3. 更新 `package.json` 依赖 +4. 执行数据库迁移脚本 +5. 验证升级结果 + +[turso-docs]: https://docs.turso.tech/cli/installation +[templates]: https://github.com/withstudiocms/templates +[environment-variables]: /zh-cn/start-here/environment-variables/ \ No newline at end of file diff --git a/src/content/docs/zh-cn/how-it-works/index.mdx b/src/content/docs/zh-cn/how-it-works/index.mdx new file mode 100644 index 00000000..79a78a7e --- /dev/null +++ b/src/content/docs/zh-cn/how-it-works/index.mdx @@ -0,0 +1,215 @@ +--- +i18nReady: true +title: "核心集成架构" +description: "深入解析 StudioCMS 如何通过其核心组件管理和交付内容" +sidebar: + order: 1 +--- + +# 架构解析 + +StudioCMS 是专为 Astro 构建的强大 CMS 系统,基于 [Astro DB](https://docs.astro.build/en/guides/astro-db/) 实现内容管理与服务。其设计兼具易用性与灵活性,能处理各种类型的内容需求。 + +扩展 StudioCMS 非常简单!您可以创建自定义插件来增强系统功能。StudioCMS 集成是整个生态系统的基石,为 Astro 项目提供无头 CMS 解决方案。以下是其核心组件的详细解析。 + +## 虚拟模块系统 + +StudioCMS 集成提供多个[虚拟模块](https://vite.dev/guide/api-plugin#virtual-modules-convention),使您能完全控制动态内容。这些模块主要供内部使用,但开发者也可访问 StudioCMS 数据: + +### 认证虚拟模块 + +| 模块路径 | 功能描述 | +|---------|---------| +| `studiocms:auth/lib/encryption` | 加密工具 | +| `studiocms:auth/lib/password` | 密码管理工具 | +| `studiocms:auth/lib/rate-limit` | 请求限流工具 | +| `studiocms:auth/lib/session` | 会话管理工具 | +| `studiocms:auth/lib/types` | 类型定义 | +| `studiocms:auth/lib/user` | 用户管理工具 | +| `studiocms:auth/utils/authEnvCheck` | 认证环境检查工具 | +| `studiocms:auth/utils/getLabelForPermissionLevel` | 权限标签工具 | + +### 核心虚拟模块 + +| 模块路径 | 功能描述 | +|---------|---------| +| `studiocms:config` | 集成配置解析 | +| `studiocms:version` | 当前版本信息 | +| `studiocms:plugins` | 运行时插件接口 | +| `studiocms:plugin-helpers` | 插件辅助函数 | +| `studiocms:components` | 导出组件库 | +| `studiocms:components/Editors` | 页面编辑器组件 | +| `studiocms:components/dashboard-grid-components` | 仪表板内部组件 | +| `studiocms:components/dashboard-grid-items` | 仪表板网格项组件 | +| `studiocms:component-proxy` | 用户自定义组件代理 | +| `studiocms:lib` | 核心库辅助工具 | + +### SDK 虚拟模块 + +| 模块路径 | 功能描述 | +|---------|---------| +| `studiocms:sdk` | 主 SDK 接口 | +| `studiocms:sdk/cache` | 带缓存的 SDK | +| `studiocms:sdk/types` | SDK 类型定义 | + +### 国际化与渲染 + +| 模块路径 | 功能描述 | +|---------|---------| +| `studiocms:i18n` | 国际化支持 | +| `studiocms:renderer` | 内容渲染器 | +| `studiocms:renderer/config` | 渲染器配置 | +| `studiocms:renderer/current` | 当前渲染上下文 | +| `studiocms:renderer/markdown-remark/css` | Markdown 样式支持 | + +### 图像处理 + +| 模块路径 | 功能描述 | +|---------|---------| +| `studiocms:imageHandler/components` | 图像处理组件 | + +## 路由系统 + +### 仪表板路由(用户界面) + +#### 主路由 + +| 路径 | 功能 | +|------|------| +| `/dashboard/` | 主控制面板 | +| `/dashboard/profile/` | 用户配置管理 | +| `/dashboard/content-management/` | 内容管理界面 | +| `/dashboard/configuration/` | 系统配置中心 | +| `/dashboard/user-management/` | 用户管理系统 | +| `/dashboard/plugins/` | 插件管理中心 | + +#### 认证路由 + +| 路径 | 功能 | +|------|------| +| `/dashboard/login/` | 登录界面 | +| `/dashboard/signup/` | 注册界面 | +| `/dashboard/logout/` | 退出登录 | + +### API 路由(后端接口) + +#### 主接口 + +| 端点路径 | 功能 | +|----------|------| +| `/studiocms_api/dashboard/api-tokens` | API 令牌管理 | +| `/studiocms_api/dashboard/search-list` | 全局搜索接口 | +| `/studiocms_api/dashboard/live-render` | 实时内容预览 | +| `/studiocms_api/dashboard/user-list-items` | 用户列表项 | +| `/studiocms_api/dashboard/editor` | 编辑器数据接口 | +| `/studiocms_api/dashboard/config` | 配置管理接口 | +| `/studiocms_api/dashboard/users` | 用户数据接口 | +| `/studiocms_api/dashboard/profile` | 用户资料接口 | +| `/studiocms_api/dashboard/create-reset-link` | 密码重置链接生成 | +| `/studiocms_api/dashboard/reset-password` | 密码重置处理 | +| `/studiocms_api/dashboard/content/page` | 页面内容操作 | +| `/studiocms_api/dashboard/content/folder` | 文件夹管理 | +| `/studiocms_api/dashboard/plugins` | 插件管理接口 | +| `/studiocms_api/dashboard/create-user` | 用户创建接口 | +| `/studiocms_api/dashboard/update-user-invite` | 用户邀请更新 | + +#### 认证接口 + +| 端点路径 | 功能 | +|----------|------| +| `/studiocms_api/auth/login` | 登录认证 | +| `/studiocms_api/auth/logout` | 退出处理 | +| `/studiocms_api/auth/register` | 注册处理 | +| `/studiocms_api/auth/github` | GitHub 认证 | +| `/studiocms_api/auth/github/callback` | GitHub 回调 | +| `/studiocms_api/auth/discord` | Discord 认证 | +| `/studiocms_api/auth/discord/callback` | Discord 回调 | +| `/studiocms_api/auth/google` | Google 认证 | +| `/studiocms_api/auth/google/callback` | Google 回调 | +| `/studiocms_api/auth/auth0` | Auth0 认证 | +| `/studiocms_api/auth/auth0/callback` | Auth0 回调 | + +#### SDK 接口 + +| 端点路径 | 功能 | +|----------|------| +| `/studiocms_api/sdk/list-pages` | 页面列表获取 | +| `/studiocms_api/sdk/fallback-list-pages.json` | 页面列表回退机制 | +| `/studiocms_api/sdk/update-latest-version-cache` | 版本缓存更新 | + +#### 渲染接口 + +| 端点路径 | 功能 | +|----------|------| +| `/studiocms_api/renderer/render` | 动态内容渲染 | + +## 开发实践指南 + +### 虚拟模块使用示例 +```ts +// 获取配置 +import config from 'studiocms:config'; + +// 使用渲染器 +import { StudioCMSRenderer } from 'studiocms:renderer'; + +// 访问SDK +import sdk from 'studiocms:sdk'; +``` + +### 自定义API端点 +```ts title="/src/pages/api/custom-endpoint.ts" +import { APIRoute } from 'astro'; +import sdk from 'studiocms:sdk'; + +export const get: APIRoute = async () => { + const pages = await sdk.GET.pages(); + return new Response(JSON.stringify(pages), { + headers: { 'Content-Type': 'application/json' } + }); +}; +``` + +### 扩展仪表板路由 +```astro title="/src/pages/dashboard/custom-page.astro" +--- +import DashboardLayout from 'studiocms:components/DashboardLayout'; +--- + + +

自定义管理页面

+ +
+``` + +## 架构优势 + +1. **模块化设计**: + - 虚拟模块实现关注点分离 + - 按功能划分的路由系统 + - 清晰的接口边界 + +2. **扩展性**: + ```ts + // 插件注册示例 + export default defineStudioCMSConfig({ + plugins: [customPlugin()] + }) + ``` + +3. **性能优化**: + - 虚拟模块按需加载 + - 缓存SDK减少数据库访问 + - 路由级代码分割 + +4. **开发体验**: + - 类型安全的虚拟模块 + - 一致的API设计规范 + - 详细的错误日志 + +> **调试提示**:在开发模式下,可通过 `?debug=1` 参数查看虚拟模块加载详情: +> ``` +> http://localhost:4321/dashboard/?debug=1 +> ``` + +此架构使 StudioCMS 既能作为开箱即用的解决方案,又能通过其扩展机制满足高度定制化需求。 \ No newline at end of file diff --git a/src/content/docs/zh-cn/how-it-works/restapi.mdx b/src/content/docs/zh-cn/how-it-works/restapi.mdx new file mode 100644 index 00000000..0485870e --- /dev/null +++ b/src/content/docs/zh-cn/how-it-works/restapi.mdx @@ -0,0 +1,165 @@ +--- +i18nReady: true +title: "REST API 开发指南" +description: "StudioCMS REST API 详细使用说明" +sidebar: + order: 4 +--- + +# 核心功能解析 + +StudioCMS REST API 是一个强大的编程接口,允许开发者通过代码与内容管理系统交互。它基于 Astro Endpoints 实现,提供符合 REST 架构规范的访问方式,为您的内容管理提供简单灵活的操作体验。 + +## API 认证机制 + +访问受保护的 API 端点需在请求头中提供认证令牌: + +```http +Authorization: Bearer <您的API令牌> +``` + +**令牌获取方式**: +1. 登录 StudioCMS 仪表板 +2. 导航至用户配置中的 "API Tokens" 区域 +3. 生成新令牌 + +> **安全提示**:每个令牌应配置最小必要权限和合理有效期(默认7天)。敏感操作建议使用短有效期令牌。 + +## 接口端点详解 + +### 公开端点(无需认证) + +这些端点提供内容的只读访问,仅支持 `GET` 方法: + +| 端点路径 | 功能说明 | +|---------|---------| +| `GET /studiocms_api/rest/v1/public/folders/` | 获取所有公开文件夹列表 | +| `GET /studiocms_api/rest/v1/public/folders/[id]` | 获取指定ID的文件夹详情 | +| `GET /studiocms_api/rest/v1/public/pages/` | 获取所有公开页面列表 | +| `GET /studiocms_api/rest/v1/public/pages/[id]` | 获取指定ID的页面详情 | + +**示例请求**: +```bash +curl https://your-domain.com/studiocms_api/rest/v1/public/pages/ \ + -H "Accept: application/json" +``` + +### 受保护端点(需认证令牌) + +完整管理接口支持多种HTTP方法: + +| 端点路径 | 支持方法 | 功能说明 | +|---------|---------|---------| +| `/studiocms_api/rest/v1/folders/` | GET, POST | 文件夹列表获取/新建 | +| `/studiocms_api/rest/v1/folders/[id]` | GET, PATCH, DELETE | 指定文件夹操作 | +| `/studiocms_api/rest/v1/pages/` | GET, POST | 页面列表获取/新建 | +| `/studiocms_api/rest/v1/pages/[id]` | GET, PATCH, DELETE | 指定页面操作 | +| `/studiocms_api/rest/v1/pages/[id]/history/` | GET | 页面历史版本列表 | +| `/studiocms_api/rest/v1/pages/[id]/history/[id]` | GET, PUT | 特定历史版本操作 | +| `/studiocms_api/rest/v1/settings/` | GET, PATCH | 系统配置获取/更新 | +| `/studiocms_api/rest/v1/users/` | GET | 用户列表获取 | +| `/studiocms_api/rest/v1/users/[id]` | GET, PATCH, DELETE | 指定用户操作 | + +**历史版本操作示例**: +```http +GET /studiocms_api/rest/v1/pages/123/history/ +→ 获取页面ID=123的所有历史版本 + +PUT /studiocms_api/rest/v1/pages/123/history/456 +→ 将页面ID=123恢复到历史版本ID=456 +``` + +## 高级功能说明 + +### 分页与筛选 + +所有列表端点支持分页参数: +```http +GET /studiocms_api/rest/v1/pages/?page=2&limit=20 +``` + +支持字段筛选: +```http +GET /studiocms_api/rest/v1/pages/?type=blog&status=published +``` + +### 批量操作 + +文件夹和页面端点支持批量创建: +```http +POST /studiocms_api/rest/v1/folders/ +Content-Type: application/json + +[ + {"name": "新文件夹1", "parent": null}, + {"name": "子文件夹", "parent": 1} +] +``` + +### 版本控制 + +历史版本接口支持: +```http +# 获取历史版本差异 +GET /studiocms_api/rest/v1/pages/123/history/456/diff + +# 创建新版本快照 +POST /studiocms_api/rest/v1/pages/123/history/ +``` + +## 最佳实践 + +### 请求示例(创建页面) +```http +POST /studiocms_api/rest/v1/pages/ +Authorization: Bearer your_api_token_here +Content-Type: application/json + +{ + "title": "API创建的文章", + "slug": "api-created-page", + "content": "## 这是通过API创建的内容", + "pageType": "blog", + "status": "draft" +} +``` + +### 响应结构 +```json +{ + "id": 789, + "title": "API创建的文章", + "slug": "api-created-page", + "createdAt": "2023-11-15T08:00:00Z", + "updatedAt": "2023-11-15T08:00:00Z", + "links": { + "self": "/studiocms_api/rest/v1/pages/789", + "history": "/studiocms_api/rest/v1/pages/789/history/" + } +} +``` + +### 错误处理 +常见HTTP状态码: +- `401 Unauthorized` - 无效/过期的令牌 +- `403 Forbidden` - 权限不足 +- `404 Not Found` - 资源不存在 +- `422 Unprocessable Entity` - 请求数据验证失败 + +```json +{ + "error": "VALIDATION_ERROR", + "message": "标题不能为空", + "details": { + "title": ["required"] + } +} +``` + +## 开发工具推荐 +使用以下工具调试API: +- [Postman](https://www.postman.com/) +- [curl 命令行工具](https://curl.se/) +- [VS Code REST Client 扩展](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) + +> **性能提示**:频繁调用的读取操作建议使用公开端点或客户端缓存策略以降低服务器负载。 \ No newline at end of file diff --git a/src/content/docs/zh-cn/how-it-works/sdk.mdx b/src/content/docs/zh-cn/how-it-works/sdk.mdx new file mode 100644 index 00000000..97d93016 --- /dev/null +++ b/src/content/docs/zh-cn/how-it-works/sdk.mdx @@ -0,0 +1,285 @@ +--- +i18nReady: true +title: "SDK 开发指南" +description: "StudioCMS SDK 详细使用说明" +sidebar: + order: 3 +--- + +import ReadMore from '~/components/ReadMore.astro'; + +StudioCMS SDK 是一个强大的编程接口,允许开发者以编程方式与 StudioCMS 交互。它提供了一系列函数和工具,用于通过 Astro DB 管理和呈现内容,同时也是 StudioCMS 仪表板的核心技术支撑。 + +## 基本使用 + +SDK 作为虚拟模块在 Astro 项目中可用,可通过以下方式导入: + +```ts twoslash +/// +// ---cut--- +import SDK from 'studiocms:sdk'; // 标准 SDK +import SDKCached from 'studiocms:sdk/cache'; // 带缓存层的 SDK +``` + +`studioCMSSDK` 对象提供完整的 CRUD 操作能力,而 `studioCMSSDKCached` 则在其基础上添加了缓存层优化性能。 + +## 标准 SDK + +### `SDK.AUTH` + +认证管理模块,提供用户认证、会话管理等功能: + +```ts twoslash +/// +// ---cut--- +import SDK from 'studiocms:sdk'; + +const { + oAuth, // OAuth 认证处理 + permission, // 权限管理 + session, // 会话控制 + user, // 用户管理 +} = SDK.AUTH; +``` + +### `SDK.INIT` + +系统初始化模块,用于 SDK 的初始配置: + +```ts twoslash +/// +// ---cut--- +import SDK from 'studiocms:sdk'; + +const { + siteConfig, // 站点配置 + ghostUser, // 系统幽灵用户 +} = SDK.INIT; +``` + +### `SDK.GET` + +数据读取模块,提供多种数据查询功能: + +```ts twoslash +/// +// ---cut--- +import SDK from 'studiocms:sdk'; + +const { + database, // 数据库操作 + databaseEntry, // 单条记录查询 + databaseTable, // 表级查询 + permissionsLists, // 权限列表 + packagePages, // 插件页面 +} = SDK.GET; +``` + +### `SDK.POST` + +数据创建模块,用于添加新记录: + +```ts twoslash +/// +// ---cut--- +import SDK from 'studiocms:sdk'; + +const { + databaseEntry, // 创建单条记录 + databaseEntries, // 批量创建记录 +} = SDK.POST; +``` + +### `SDK.UPDATE` + +数据更新模块,支持内容修改操作: + +```ts twoslash +/// +// ---cut--- +import SDK from 'studiocms:sdk'; + +const { + page, // 页面更新 + pageContent, // 内容更新 + tags, // 标签管理 + categories, // 分类管理 + permissions, // 权限更新 + siteConfig, // 配置更新 + folder, // 文件夹管理 +} = SDK.UPDATE; +``` + +### `SDK.DELETE` + +数据删除模块,提供精准的数据移除能力: + +```ts twoslash +/// +// ---cut--- +import SDK from 'studiocms:sdk'; + +const { + page, // 页面删除 + pageContent, // 内容删除 + pageContentLang, // 多语言内容删除 + tags, // 标签删除 + categories, // 分类删除 + permissions, // 权限移除 + diffTracking, // 变更追踪删除 + folder, // 文件夹删除 + user, // 用户删除 +} = SDK.DELETE; +``` + +### `SDK.db` + +直接操作 Astro DB 的核心接口: + +```ts twoslash +/// +// ---cut--- +import SDK from 'studiocms:sdk'; + +const { db } = SDK; // 直接数据库访问 +``` + +深入了解 `db` 用法请参阅 [Astro DB 指南](https://docs.astro.build/en/guides/astro-db/) + +### `SDK.REST_API` + +REST API 底层处理模块: + +```ts twoslash +/// +// ---cut--- +import SDK from 'studiocms:sdk'; + +const { + tokens: { + get: getToken, // 获取令牌 + new: newToken, // 创建新令牌 + delete: deleteToken, // 删除令牌 + verify: verifyToken, // 验证令牌 + }, +} = SDK.REST_API; +``` + +### `SDK.diffTracking` + +变更追踪系统,记录数据历史版本: + +```ts twoslash +/// +// ---cut--- +import SDK from 'studiocms:sdk'; + +const { + insert, // 插入变更记录 + clear, // 清除变更记录 + get, // 获取变更记录 + revertToDiff // 回滚到指定版本 +} = SDK.diffTracking; +``` + +### 工具函数集合 + +SDK 提供丰富的实用工具: + +```ts twoslash +/// +// ---cut--- +import SDK from 'studiocms:sdk'; + +// 文件夹操作 +const { addPageToFolderTree } = SDK; + +// 节点查询 +const { findNodeById, findNodeByPath } = SDK; + +// ID 处理 +const { parseIdNumberArray, generateRandomIDNumber } = SDK; + +// 安全功能 +const { generateToken, verifyRank } = SDK; + +// 数据收集 +const { collectCategories, collectUserData } = SDK; + +// 其他工具 +const { getFullPath, buildFolderTree } = SDK; +``` + +## 缓存版 SDK + +带缓存层的 SDK 导入方式: + +```ts twoslash +/// +// ---cut--- +import SDKCached from 'studiocms:sdk/cache'; +``` + +### `SDKCached.GET` + +带缓存的数据读取接口: + +```ts twoslash +/// +// ---cut--- +import SDKCached from 'studiocms:sdk/cache'; + +const { + page, // 单页面缓存读取 + pages, // 多页面缓存读取 + siteConfig, // 配置缓存 + latestVersion, // 最新版本号 + folderTree, // 文件夹树结构 + pageFolderTree, // 页面文件夹结构 + folderList, // 文件夹列表 + folder, // 单文件夹 +} = SDKCached.GET; +``` + +### `SDKCached.CLEAR` + +缓存清除功能: + +```ts twoslash +/// +// ---cut--- +import SDKCached from 'studiocms:sdk/cache'; + +const { + page, // 清除页面缓存 + pages, // 清除多页面缓存 + latestVersion, // 清除版本缓存 + folderTree, // 清除文件夹树缓存 + folderList, // 清除文件夹列表缓存 +} = SDKCached.CLEAR; +``` + +### `SDKCached.UPDATE` + +带缓存更新的操作接口: + +```ts twoslash +/// +// ---cut--- +import SDKCached from 'studiocms:sdk/cache'; + +const { + page, // 更新页面缓存 + siteConfig, // 更新配置缓存 + latestVersion, // 更新版本缓存 + folderTree, // 更新文件夹树 + folderList, // 更新文件夹列表 + folder, // 更新单个文件夹 +} = SDKCached.UPDATE; +``` + +### `SDKCached.db` + +透明传递的标准 `db` 对象: + +详见上文 [`SDK.db`](#sdkdb) 说明 \ No newline at end of file diff --git a/src/content/docs/zh-cn/index.mdx b/src/content/docs/zh-cn/index.mdx new file mode 100644 index 00000000..42488105 --- /dev/null +++ b/src/content/docs/zh-cn/index.mdx @@ -0,0 +1,97 @@ +--- +i18nReady: true +title: StudioCMS 文档 +description: 开始使用 StudioCMS 进行构建 +template: splash +editUrl: false +lastUpdated: false +hero: + tagline: 指南和资源助您学习使用 StudioCMS + image: + alt: StudioCMS 徽标 + dark: ../../../assets/logos/studioCMS.png + light: ../../../assets/logos/studioCMS-dark.png + actions: + - text: 开始使用 + link: /zh-cn/start-here/getting-started/ + icon: right-arrow + variant: primary + - text: GitHub 仓库 + link: https://github.com/withstudiocms/studiocms/ + icon: github +--- + +import { CardGrid, LinkButton } from '@astrojs/starlight/components'; +import Youtube from '~/components/Youtube.astro'; +import Card from '~/components/landing/Card.astro'; +import ListCard from '~/components/landing/ListCard.astro'; +import SplitCard from '~/components/landing/SplitCard.astro'; +import { Center } from 'studiocms:ui/components'; + + + + + + + + ```sh + # 创建新的 Astro 项目 + pnpm create studiocms@latest + + # 启动开发服务器 + cd my-studiocms-project + pnpm dev + ``` + +
+ 有关所需环境变量的更多信息,请参阅 [环境变量][environment-variables] 页面。 + + 如需更深入的指南,请查看 [入门指南][getting-started]。 + + 需要 libSQL 数据库?请了解 [Turso][turso]。 +
+ +
+ + + - [入门指南][getting-started] + - [环境变量][environment-variables] + - [为何选择 StudioCMS?][why-studiocms] + - [理解 StudioCMS][how-it-works] + + + + - [使用 SDK][using-the-sdk] + - [使用 REST API][using-rest-api] + - [查找和使用插件][package-catalog] + - [了解插件 API][plugin-api] + + +
+ +
+
+ 想参与 StudioCMS 社区吗? + + + 加入我们的 Discord! + +
+
+ +{/* Page MD Links */} +[environment-variables]: /zh-cn/start-here/getting-started/ +[getting-started]: /zh-cn/start-here/getting-started/ +[turso]: https://tur.so/studiocms +[why-studiocms]: /zh-cn/start-here/why-studiocms/ +[how-it-works]: /zh-cn/how-it-works/ +[using-the-sdk]: /zh-cn/how-it-works/sdk/ +[using-rest-api]: /zh-cn/how-it-works/restapi/ +[package-catalog]: /zh-cn/package-catalog/ +[plugin-api]: /zh-cn/plugins/ \ No newline at end of file diff --git a/src/content/docs/zh-cn/package-catalog/community-plugins/web-vitals.mdx b/src/content/docs/zh-cn/package-catalog/community-plugins/web-vitals.mdx new file mode 100644 index 00000000..edb078bc --- /dev/null +++ b/src/content/docs/zh-cn/package-catalog/community-plugins/web-vitals.mdx @@ -0,0 +1,76 @@ +--- +i18nReady: true +title: "@astrojs/web-vitals" +type: integration +catalogEntry: astrojs-web-vitals +description: "将网页指标集成到 StudioCMS 仪表盘" +sidebar: + badge: + text: '插件' + variant: 'tip' +--- + +import { PackageManagers } from 'starlight-package-managers' +import Gallery from '~/components/Gallery.astro'; +import { webVitalsImages } from "~/assets/index.ts"; +import { Steps, Tabs, TabItem } from '@astrojs/starlight/components'; + +# 简介 + +该 Astro 集成支持跟踪真实世界的网站性能数据并将数据存储在 Astro DB 中。这些数据会在 StudioCMS 仪表盘中展示您的网站随时间变化的真实性能指标。 + +## 安装步骤 + + +{/* */} + +1. 安装软件包并将其添加到 Astro 配置中: + + + +2. 将新配置推送到您的远程数据库: + + + +{/* */} + + +{/* */} + +1. 使用以下命令安装软件包: + + + +2. 将 `@astrojs/web-vitals` 添加到您的 Astro 配置文件: + + ```ts twoslash title="astro.config.mjs" {12} ins={4, 13} + import node from '@astrojs/node'; + import studioCMS from 'studiocms'; + import db from '@astrojs/db'; + import webVitals from '@astrojs/web-vitals'; // 导入网页指标集成 + import { defineConfig } from 'astro/config'; + + export default defineConfig({ + site: 'https://demo.studiocms.dev/', + output: 'server', + adapter: node({ mode: "standalone" }), + integrations: [ + db(), // 必须项 + webVitals(), // 启用网页指标跟踪 + studioCMS(), // StudioCMS 核心集成 + ], + }); + ``` + +3. 将新配置推送到您的远程数据库: + + + +{/* */} + + + + +{/* ## 功能演示图库 + + */} \ No newline at end of file diff --git a/src/content/docs/zh-cn/package-catalog/index.mdx b/src/content/docs/zh-cn/package-catalog/index.mdx new file mode 100644 index 00000000..8e0654b4 --- /dev/null +++ b/src/content/docs/zh-cn/package-catalog/index.mdx @@ -0,0 +1,28 @@ +--- +i18nReady: true +title: Packages +description: The Package Catalog is a collection of packages by StudioCMS or its community. +--- + +import PackageCatalog from '~/components/PackageCatalog.astro' +import { Badge } from '@astrojs/starlight/components'; + +The Package Catalog is a collection of packages by StudioCMS or its community members, that are not included within StudioCMS by default. All packages listed here are verified and tested by the StudioCMS team or its contributors. + +Any package labeled as a is a package that extends the functionality of StudioCMS or its dashboard. + +Plugins can also be labeled as which means the plugin is still early in development and could face major changes to its internals at any time. This plugin may or may not also be ready for usage. + +Any package labeled as is able to be installed and used in projects that do not rely on studiocms. They can work on their own. + +## Package Catalogs + +### StudioCMS Packages +--- + + + +### Community Packages +--- + + \ No newline at end of file diff --git a/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-blog.mdx b/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-blog.mdx new file mode 100644 index 00000000..1afb863f --- /dev/null +++ b/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-blog.mdx @@ -0,0 +1,236 @@ +--- +i18nReady: true +title: "@studiocms/blog" +type: integration +catalogEntry: studiocms-blog +description: "StudioCMS 博客集成插件" +sidebar: + badge: + text: '插件' + variant: 'tip' +--- + +import { PackageManagers } from 'starlight-package-managers' +import { Steps, Tabs, TabItem } from '@astrojs/starlight/components'; + +# 简介 + +该插件为 Astro 项目提供 StudioCMS 博客功能及前端界面,支持从 StudioCMS 仪表盘创建、编辑和管理博客文章。 + +## 安装步骤 + +1. 使用以下命令安装软件包: + + + +2. 在 StudioCMS 配置中添加该插件: + + ```ts twoslash title="studiocms.config.mjs" {2, 6} + import { defineStudioCMSConfig } from 'studiocms/config'; + import blog from '@studiocms/blog'; // 导入博客插件 + + export default defineStudioCMSConfig({ + plugins: [ + blog(), // 启用博客功能 + ], + }); + ``` +## 核心功能 + +### 此集成提供的能力 + +该插件将向 StudioCMS 控制的前端应用添加以下路由: + +- `/[...slug]` - 通用内容路由(用于常规页面) +- `/blog` - 博客主页(文章列表) +- `/blog/[slug]` - 单篇博客文章详情页 +- `/rss.xml` - 自动生成的博客 RSS 订阅源 + +### 高级配置 +```ts twoslash {4-6} title="自定义博客路径" +import blog from '@studiocms/blog'; + +export default defineStudioCMSConfig({ + plugins: [ + blog({ + basePath: '/articles', // 修改博客基础路径 + postRoute: '/entry' // 修改文章详情路径 + }), + ], +}); +``` + +### 博文数据结构 +```graphql +type BlogPost { + id: ID! + title: String! + excerpt: String + content: RichText! + featuredImage: Asset + tags: [Tag!]! + publishDate: DateTime! + author: User! +} +``` + +## 使用说明 + +### 创建博文流程 +1. 登录 StudioCMS 仪表盘 +2. 导航到**博客 → 文章** +3. 点击**新建文章** +4. 填写内容并设置特色图片 +5. 选择发布状态:草稿/立即发布/定时发布 + +### 模板定制 +默认模板文件位置: +```bash +src/ + components/ + studiocms/ + blog/ + BlogList.astro # 博客列表页组件 + BlogPost.astro # 博文详情页组件 +``` +可复制这些文件到您的项目中进行覆盖: +```astro title="src/layouts/BlogLayout.astro" +--- +// 自定义博客布局 +--- + + + 我的技术博客 + + +
网站导航栏
+ +
© 2024 我的博客
+ + +``` + +> **性能提示**:对内容密集型博客,建议在 `.env` 文件中设置: +> ```ini +> STUDIOCMS_BLOG_PAGE_SIZE=10 # 每页显示10篇文章 +> STUDIOCMS_PREVIEW_IMAGE_QUALITY=80 # 预览图质量压缩 +> ``` + +```markdown +--- +i18nReady: true +title: "@studiocms/blog" +type: integration +catalogEntry: studiocms-blog +description: "StudioCMS 博客集成插件" +sidebar: + badge: + text: '插件' + variant: 'tip' +--- + +import { PackageManagers } from 'starlight-package-managers' +import { Steps, Tabs, TabItem } from '@astrojs/starlight/components'; + +# 简介 + +该插件为 Astro 项目提供 StudioCMS 博客功能及前端界面,支持从 StudioCMS 仪表盘创建、编辑和管理博客文章。 + +## 安装步骤 + +1. 使用以下命令安装软件包: + + + +2. 在 StudioCMS 配置中添加该插件: + + ```ts twoslash title="studiocms.config.mjs" {2, 6} + import { defineStudioCMSConfig } from 'studiocms/config'; + import blog from '@studiocms/blog'; // 导入博客插件 + + export default defineStudioCMSConfig({ + plugins: [ + blog(), // 启用博客功能 + ], + }); + ``` +## 核心功能 + +### 此集成提供的能力 + +该插件将向 StudioCMS 控制的前端应用添加以下路由: + +- `/[...slug]` - 通用内容路由(用于常规页面) +- `/blog` - 博客主页(文章列表) +- `/blog/[slug]` - 单篇博客文章详情页 +- `/rss.xml` - 自动生成的博客 RSS 订阅源 + +### 高级配置 +```ts twoslash {4-6} title="自定义博客路径" +import blog from '@studiocms/blog'; + +export default defineStudioCMSConfig({ + plugins: [ + blog({ + basePath: '/articles', // 修改博客基础路径 + postRoute: '/entry' // 修改文章详情路径 + }), + ], +}); +``` + +### 博文数据结构 +```graphql +type BlogPost { + id: ID! + title: String! + excerpt: String + content: RichText! + featuredImage: Asset + tags: [Tag!]! + publishDate: DateTime! + author: User! +} +``` + +## 使用说明 + +### 创建博文流程 +1. 登录 StudioCMS 仪表盘 +2. 导航到**博客 → 文章** +3. 点击**新建文章** +4. 填写内容并设置特色图片 +5. 选择发布状态:草稿/立即发布/定时发布 + +### 模板定制 +默认模板文件位置: +```bash +src/ + components/ + studiocms/ + blog/ + BlogList.astro # 博客列表页组件 + BlogPost.astro # 博文详情页组件 +``` +可复制这些文件到您的项目中进行覆盖: +```astro title="src/layouts/BlogLayout.astro" +--- +// 自定义博客布局 +--- + + + 我的技术博客 + + +
网站导航栏
+ +
© 2024 我的博客
+ + +``` + +> **性能提示**:对内容密集型博客,建议在 `.env` 文件中设置: +> ```ini +> STUDIOCMS_BLOG_PAGE_SIZE=10 # 每页显示10篇文章 +> STUDIOCMS_PREVIEW_IMAGE_QUALITY=80 # 预览图质量压缩 +> ``` \ No newline at end of file diff --git a/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-devapps.mdx b/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-devapps.mdx new file mode 100644 index 00000000..09463893 --- /dev/null +++ b/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-devapps.mdx @@ -0,0 +1,127 @@ +--- +i18nReady: true +title: "@studiocms/devapps" +type: integration +catalogEntry: studiocms-devapps +description: "在 Astro 开发模式下可用的实用工具集合" +sidebar: + badge: + text: '公开可用' + variant: 'caution' +--- + +import { PackageManagers } from 'starlight-package-managers' +import { Steps, Tabs, TabItem } from '@astrojs/starlight/components'; + +# 简介 + +这是一个在 Astro 开发模式下可用的实用工具集合。 + +## 安装方法 + + + +1. 使用以下命令安装软件包并添加到 astro 配置: + + + +2. 按照下文 [示例配置](#示例配置) 更新配置文件 + + +1. 使用以下命令安装软件包: + + + +2. 将 `@studiocms/devapps` 添加到您的 astro 配置文件: + + ```ts twoslash title="astro.config.mjs" ins={3, 9} + import { defineConfig } from 'astro/config'; + import db from '@astrojs/db'; + import devApps from '@studiocms/devapps'; + + export default defineConfig({ + site: "https://example.com", + integrations: [ + db(), + devApps(), + ], + }); + ``` + + + +## 使用说明 + +所有工具仅在 `astro dev` 开发模式下可用,不会出现在生产部署中! + +### 示例配置 + +```ts twoslash title="astro.config.mjs" {2, 8} ins={3, 9} +import { defineConfig } from 'astro/config'; +import db from '@astrojs/db'; +import devApps from '@studiocms/devapps'; + +export default defineConfig({ + site: "https://example.com", + integrations: [ + db(), // 必须项 + devApps(/* 配置选项见下文 */), + ], +}); +``` + +### 配置选项 + +以下是 `devApps` 集成的完整可用选项,其中显示了默认值。**所有选项均为可选**。 + +```ts twoslash +import devApps from '@studiocms/devapps'; +devApps({ +// ---cut--- +endpoint: '_studiocms-devapps', +verbose: false, +appsConfig: { + libSQLViewer: true, + wpImporter: true, +}, +// ---cut-after--- +}) +``` + +## 可用工具 + +### libSQL 查看器 + +在浏览器中查看 libSQL 数据库表的开发工具。该工具依赖于 `@astrojs/db` 的远程数据库连接凭证。 + +#### 环境要求 + +需设置以下环境变量(同时用于 `@astrojs/db`): +- **`ASTRO_DB_REMOTE_URL`** +- **`ASTRO_DB_APP_TOKEN`** + +#### 功能预览 + +- 工具栏应用 (收缩状态) + +![Astro 开发工具栏应用](~/assets/devapps/devapps-1-toolbar-app-closed.png) + +- 工具栏应用 (展开状态) + +![Astro 开发工具栏应用 (展开)](~/assets/devapps/devapps-1-toolbar-app-expanded.png) + +### WordPress 导入器 + +将 WordPress 文章和页面导入到 StudioCMS 数据库的开发工具。 + +#### 环境要求 + +- StudioCMS 集成 +- WordPress 安装 +- `@studiocms/blog` (可选:用于将文章导入到博客系统) + +#### 功能预览 + +- 工具栏应用 + +![Astro 导入器界面](~/assets/devapps/devapps-2-importer.png) \ No newline at end of file diff --git a/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-markdoc.mdx b/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-markdoc.mdx new file mode 100644 index 00000000..e42bbf12 --- /dev/null +++ b/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-markdoc.mdx @@ -0,0 +1,36 @@ +--- +i18nReady: true +title: "@studiocms/markdoc" +type: integration +catalogEntry: studiocms-markdoc +description: "StudioCMS MarkDoc 集成插件" +sidebar: + badge: + text: '插件' + variant: 'tip' +--- + +import { PackageManagers } from 'starlight-package-managers' +import { Steps, Tabs, TabItem } from '@astrojs/starlight/components'; + +# 简介 + +此插件为 StudioCMS 添加 MarkDoc 文件格式支持。 + +## 安装步骤 + +1. 使用以下命令安装软件包: + + + +2. 在 StudioCMS 配置中添加该插件: + + ```ts twoslash title="studiocms.config.mjs" {2, 6} + import { defineStudioCMSConfig } from 'studiocms/config'; + import markdoc from '@studiocms/markdoc'; + + export default defineStudioCMSConfig({ + plugins: [ + markdoc(), + ], + }); \ No newline at end of file diff --git a/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-mdx.mdx b/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-mdx.mdx new file mode 100644 index 00000000..c4054f43 --- /dev/null +++ b/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-mdx.mdx @@ -0,0 +1,36 @@ +--- +i18nReady: true +title: "@studiocms/mdx" +type: integration +catalogEntry: studiocms-mdx +description: "StudioCMS MDX 集成插件" +sidebar: + badge: + text: '插件' + variant: 'tip' +--- + +import { PackageManagers } from 'starlight-package-managers' +import { Steps, Tabs, TabItem } from '@astrojs/starlight/components'; + +# 简介 + +此插件为 StudioCMS 添加 MDX 文件格式支持。 + +## 安装步骤 + +1. 使用以下命令安装软件包: + + + +2. 在 StudioCMS 配置中添加该插件: + + ```ts twoslash title="studiocms.config.mjs" {2, 6} + import { defineStudioCMSConfig } from 'studiocms/config'; + import mdx from '@studiocms/mdx'; + + export default defineStudioCMSConfig({ + plugins: [ + mdx(), + ], + }); \ No newline at end of file diff --git a/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-wysiwyg.mdx b/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-wysiwyg.mdx new file mode 100644 index 00000000..52ba1929 --- /dev/null +++ b/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-wysiwyg.mdx @@ -0,0 +1,36 @@ +--- +i18nReady: true +title: "@studiocms/wysiwyg" +type: integration +catalogEntry: studiocms-wysiwyg +description: "轻松为 StudioCMS 项目添加所见即所得编辑器!" +sidebar: + badge: + text: '实验性' + variant: 'danger' +--- + +import { PackageManagers } from 'starlight-package-managers' +import { Steps, Tabs, TabItem } from '@astrojs/starlight/components'; + +# 简介 + +此插件让您能够轻松地为 StudioCMS 项目添加所见即所得编辑器! + +## 安装步骤 + +1. 使用以下命令安装软件包: + + + +2. 在 StudioCMS 配置中添加该插件: + + ```ts twoslash title="studiocms.config.mjs" {2, 6} + import { defineStudioCMSConfig } from 'studiocms/config'; + import wysiwyg from '@studiocms/wysiwyg'; + + export default defineStudioCMSConfig({ + plugins: [ + wysiwyg(), + ], + }); \ No newline at end of file diff --git a/src/content/docs/zh-cn/plugins/extended.mdx b/src/content/docs/zh-cn/plugins/extended.mdx new file mode 100644 index 00000000..67b06190 --- /dev/null +++ b/src/content/docs/zh-cn/plugins/extended.mdx @@ -0,0 +1,367 @@ +--- +i18nReady: true +title: 构建高效插件 +description: StudioCMS 插件开发指南 +sidebar: + order: 2 + badge: + text: 已更新 + variant: success +--- + +import ReadMore from '~/components/ReadMore.astro' +import { FileTree } from '@astrojs/starlight/components' + +# 插件开发指南 + +开发 StudioCMS 插件是扩展平台功能的关键方式,它提供了一种简单灵活的方法来增强项目能力。本文将通过基础示例演示如何创建和开发 StudioCMS 插件。 + +## 准备工作 + +开始前需要搭建插件基本结构: + + + +- package.json +- src + - index.ts + - routes + - [...slug].astro + - dashboard-grid-items + - MyPluginGridItem.astro + + + +## 创建插件核心 + +在 `src/index.ts` 文件中定义 StudioCMS 插件。以下示例展示了如何创建一个支持 Astro 集成的博客插件: + +```ts twoslash title="index.ts" +import { definePlugin } from 'studiocms/plugins'; +import { AstroIntegration } from 'astro'; +import { addVirtualImports, createResolver } from 'astro-integration-kit'; + +// 定义插件选项接口 +interface Options { + route: string; +} + +export function studioCMSPageInjector(options: Options) { + // 解析当前文件路径 + const { resolve } = createResolver(import.meta.url); + + // 定义 Astro 集成 + function myIntegration(options: Options): AstroIntegration { + const route = `/${options?.route || 'my-plugin'}`; + + return { + name: 'my-astro-integration', + hooks: { + "astro:config:setup": (params) => { + const { injectRoute } = params; + + // 注入插件路由 + injectRoute({ + entrypoint: resolve('./routes/[...slug].astro'), + pattern: `/${route}/[...slug]`, + prerender: false, + }) + + // 添加虚拟导入 + addVirtualImports(params, { + name: 'my-astro-integration', + imports: { + 'myplugin:config': ` + export const options = ${JSON.stringify({ route })}; + export default options; + `, + } + }) + } + } + } + } + + // 定义 StudioCMS 插件 + return definePlugin({ + identifier: 'my-plugin', // 唯一标识符 + name: 'My Plugin', // 插件名称 + studiocmsMinimumVersion: '0.1.0-beta.18', // 兼容最低版本 + hooks: { + // 添加 Astro 集成 + 'studiocms:astro:config': ({ addIntegrations }) => { + addIntegrations(myIntegration(options)); + }, + // 插件配置设置 + 'studiocms:config:setup': ({ setDashboard, setFrontend, setRendering }) => { + // 仪表板网格项配置 + setDashboard({ + dashboardGridItems: [ + { + name: 'example', // 组件名称 + span: 2, // 网格跨度 + variant: 'default', // 显示变体 + requiresPermission: 'editor', // 所需权限 + header: { title: '示例', icon: 'bolt' }, // 标题和图标 + body: { + html: '', // 占位HTML + components: { + // 实际渲染组件 + examplegriditem: resolve('./dashboard-grid-items/MyPluginGridItem.astro') + } + } + } + ], + }); + + // 前端导航配置 + setFrontend({ + frontendNavigationLinks: [{ label: '我的插件', href: options?.route || 'my-plugin' }], + }); + + // 页面类型配置 + setRendering({ + pageTypes: [{ identifier: 'my-plugin', label: '博客文章(我的插件)' }], + }) + } + } + }); +} +``` + +此示例创建了包含路由注入和仪表板组件的插件,实现了一个基础博客功能。 + +深入了解 Astro 集成开发,请参阅 [Astro 集成套件](https://astro-integration-kit.netlify.app/) 和 [Astro 集成文档](https://docs.astro.build/en/reference/integrations-reference/) + +## 路由实现示例 + +在 `src/routes/[...slug].astro` 文件中定义插件路由。此示例分两部分展示:前端处理层(`---` 之间)和模板层(第二个 `---` 下方): + +```ts twoslash title="前端处理层" +// @noErrors +// @filename: plugin.d.ts +declare module 'myplugin:config' { + export const options: { route: string }; + export default options; +} +// ---cut--- +// @filename: Frontmatter.ts +/// +/// +import type { AstroGlobal } from 'astro'; +const Astro: AstroGlobal = {}; +// ---cut--- +import { StudioCMSRenderer } from 'studiocms:renderer'; +import sdk from 'studiocms:sdk'; +import config from 'myplugin:config'; + +// 生成完整路由路径 +const makeRoute = (slug: string) => { + return `/${config.route}/${slug}`; +} + +// 获取 'my-plugin' 类型的所有页面 +const pages = await sdk.GET.packagePages('my-plugin'); + +// 获取当前 URL slug +const { slug } = Astro.params; + +// 查找匹配页面 +const page = pages.find((page) => page.slug === slug || ''); +``` + +```astro title="模板层" +{ + slug && page ? ( +
+

{page.title}

+ +
+ ) : ( +
+

我的插件

+
    + {pages.length > 0 && pages.map((page) => ( +
  • + {page.title} +
  • + ))} +
+
+ ) +} +``` + +此[动态路由](https://docs.astro.build/en/guides/routing/#dynamic-routes)在没有 slug 参数时显示文章列表,有 slug 时显示具体文章内容。 + +## 仪表板组件示例 + +在 `src/dashboard-grid-items/MyPluginGridItem.astro` 中创建仪表板组件: + +```astro title="MyPluginGridItem.astro" +--- +import { StudioCMSRoutes } from 'studiocms:lib'; +import sdk from 'studiocms:sdk'; + +// 获取 'my-plugin' 类型的所有页面 +const pages = await sdk.GET.packagePages('my-plugin'); + +// 筛选最近30天更新的前5篇文章 +const recentlyUpdatedPages = pages + .filter((page) => { + const now = new Date(); + const thirtyDaysAgo = new Date(now.setDate(now.getDate() - 30)); + return new Date(page.updatedAt) > thirtyDaysAgo; + }) + .sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime()) + .slice(0, 5); +--- + +
+

最近更新

+
    + {recentlyUpdatedPages.length > 0 && recentlyUpdatedPages.map((page) => ( +
  • + + + {page.title} + +
  • + ))} +
+
+``` + +此组件在仪表板显示最近更新的文章列表,点击可直接进入编辑界面。 + +## 导航组件集成 + +若想像 `@studiocms/blog` 插件那样使用内置导航助手,可创建自定义导航组件: + +```astro title="Navigation.astro" +--- +import { StudioCMSRoutes } from 'studiocms:lib'; +import studioCMS_SDK from 'studiocms:sdk/cache'; +import { frontendNavigation } from 'studiocms:plugin-helpers'; + +// 组件属性定义 +interface Props { + topLevelLinkCount?: number; +}; + +// 默认显示3个顶级导航项 +const { topLevelLinkCount = 3 } = Astro.props; + +// 获取站点配置 +const config = (await studioCMS_SDK.GET.siteConfig()).data; +const { title } = config || { title: 'StudioCMS' }; + +// 基础URL +const { mainLinks: { baseSiteURL } } = StudioCMSRoutes; + +// 导航项类型 +type LinkProps = { + text: string; + href: string; +}; + +// 获取导航链接 +const links: LinkProps[] = await frontendNavigation(); +--- + +{ ( links.length < topLevelLinkCount || links.length === topLevelLinkCount ) && ( + +) } + + +{ links.length > topLevelLinkCount && ( + +) } +``` + +此组件利用 StudioCMS 导航助手创建响应式导航系统,根据链接数量自动切换常规/下拉模式。添加 CSS 样式后即可获得完整功能的导航菜单。 + +### 开发建议: + +1. **性能优化**: + ```ts + // 在数据请求中使用缓存策略 + const data = await sdk.GET.packagePages('my-plugin', { + cachePolicy: { lifetime: '10m' } + }); + ``` + +2. **错误处理**: + ```astro + try { + const pages = await sdk.GET.packagePages('my-plugin'); + } catch (error) { + console.error("插件数据获取失败:", error); + return

加载数据失败

; + } + ``` + +3. **国际化支持**: + ```ts + // 在插件定义中添加多语言支持 + definePlugin({ + name: { + en: 'My Plugin', + zh: '我的插件' + }, + // ...其他配置 + }) + ``` + +4. **版本兼容**: + ```json + // package.json 中声明兼容的 StudioCMS 版本 + "peerDependencies": { + "studiocms": "^0.1.0-beta.18" + } + ``` + +通过遵循此模式,您可以构建出功能强大、易于维护的 StudioCMS 插件,充分扩展平台能力。 \ No newline at end of file diff --git a/src/content/docs/zh-cn/plugins/index.mdx b/src/content/docs/zh-cn/plugins/index.mdx new file mode 100644 index 00000000..5a20b275 --- /dev/null +++ b/src/content/docs/zh-cn/plugins/index.mdx @@ -0,0 +1,129 @@ +--- +i18nReady: true +title: 插件基础指南 +description: StudioCMS 插件工作原理详解 +sidebar: + order: 1 + badge: + text: 已更新 + variant: success +--- + +import ReadMore from '~/components/ReadMore.astro' + +# 核心概念解析 + +StudioCMS 插件是扩展平台功能的核心机制,提供了一种简单灵活的方式来增强项目能力。本文将深入解析 StudioCMS 插件的工作原理和基础结构。 + +## 什么是插件? + +StudioCMS 插件类似于 Astro 集成(Integrations),但在函数对象上附加了额外元数据。这些元数据用于确定插件的加载和使用方式。插件通过添加新功能或修改现有行为来扩展 StudioCMS 的能力。 + +### StudioCMS 插件接口定义 + +```ts +interface StudioCMSPlugin { + identifier: string; // 插件唯一标识符 + name: string; // 插件显示名称 + studiocmsMinimumVersion: string; // 要求的最低 StudioCMS 版本 + hooks: { + // Astro 配置钩子 + 'studiocms:astro:config': (params: { + logger: AstroIntegrationLogger; // 日志记录器 + addIntegrations: (args_0: AstroIntegration | AstroIntegration[]) => void; // 添加集成 + }) => void | Promise; + + // 配置初始化钩子 + 'studiocms:config:setup': (params: { + logger: AstroIntegrationLogger; + // 设置站点地图 + setSitemap: (params: { + triggerSitemap?: boolean | undefined; + sitemaps?: { + pluginName: string; + sitemapXMLEndpointPath: string | URL; + }[] | undefined; + }) => void; + // 设置仪表板 + setDashboard: (params: { + dashboardGridItems?: GridItemInput[] | undefined; + dashboardPages?: { + user?: (...)[] | undefined; + admin?: (...)[] | undefined; + } | undefined; + settingsPage?: { + fields: (...)[]; + endpoint: string; + } | undefined; + }) => void; + // 设置前端 + setFrontend: (params: { + frontendNavigationLinks?: { + label: string; // 导航标签 + href: string; // 链接地址 + }[] | undefined; + }) => void; + // 设置渲染 + setRendering: (params: { + pageTypes?: { + label: string; // 页面类型标签 + identifier: string; // 唯一标识符 + description?: string | undefined; // 描述 + fields?: (...)[] | undefined; // 字段定义 + pageContentComponent?: string | undefined; // 内容组件 + rendererComponent?: string | undefined; // 渲染组件 + apiEndpoint?: string | undefined; // API端点 + }[] | undefined; + }) => void; + }) => void | Promise; + } +} +``` + +### 插件定义规范 + +定义 StudioCMS 插件需创建符合上述接口的对象,必须包含以下属性: + +- `identifier`: 插件的唯一标识符(通常取自 package.json) +- `name`: 在 StudioCMS 仪表板中显示的插件名称 +- `studiocmsMinimumVersion`: 插件所需的最低 StudioCMS 版本 + +```ts twoslash title="my-plugin.ts" +import { definePlugin } from 'studiocms/plugins'; +import { AstroIntegration } from 'astro'; + +// 定义插件和集成的选项接口 +interface Options { + foo: string; // 示例配置项 +} + +// 创建 Astro 集成 +const myIntegration = (options: Options): AstroIntegration => ({ + name: 'my-astro-integration', + hooks: { + "astro:config:setup": () => { + console.log('我的 Astro 集成已启动!'); + } + } +}); + +// 定义 StudioCMS 插件 +export const myPlugin = (options: Options) => definePlugin({ + identifier: 'my-plugin', // 插件标识符 + name: '我的插件', // 插件显示名称 + studiocmsMinimumVersion: '0.1.0-beta.18', // 最低兼容版本 + hooks: { + // Astro 配置钩子 + 'studiocms:astro:config': ({ addIntegrations }) => { + addIntegrations(myIntegration(options)) // 推荐添加集成 + } + } +}); +``` + +此示例定义了一个需要 StudioCMS v0.1.0-beta.18+ 的插件。当触发 `astro:config:setup` 生命周期钩子时,会在控制台打印消息。 + +深入了解插件开发实践,请参阅[高效插件开发指南][extended-plugins] + +{/* 文档链接 */} +[extended-plugins]: /zh-cn/plugins/extended/ \ No newline at end of file diff --git a/src/content/docs/zh-cn/start-here/configuration.mdx b/src/content/docs/zh-cn/start-here/configuration.mdx new file mode 100644 index 00000000..c2da6a01 --- /dev/null +++ b/src/content/docs/zh-cn/start-here/configuration.mdx @@ -0,0 +1,87 @@ +--- +i18nReady: true +title: "StudioCMS 配置" +description: "定义 StudioCMS 配置的选项" +sidebar: + order: 3 +--- + +import { FileTree } from '@astrojs/starlight/components'; +import ReadMore from '~/components/ReadMore.astro'; + +# 可用配置选项 + +有两种方式配置 StudioCMS 集成。以下示例展示了如何在 `astro.config.mjs` 文件或专用的 `studiocms.config.mjs` 文件中进行配置。 + + +本页面展示如何定义 StudioCMS 配置及其位置。有关配置选项的完整参考,请查看[配置参考文档][reference-page]。 + + +## 使用 `astro.config.mjs` 文件 + +```ts twoslash title="astro.config.mjs" +import db from '@astrojs/db'; +import node from '@astrojs/node'; +import studioCMS from 'studiocms'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + site: 'https://demo.studiocms.dev/', + output: 'server', + adapter: node({ mode: "standalone" }), + integrations: [ + db(), + studioCMS({ + dbStartPage: false, + // 其他配置选项 + }), + ], +}); +``` + +## 使用 `studiocms.config.mjs` 文件(推荐) + +此文件将被自动识别,并覆盖 `astro.config.mjs` 中的任何配置选项。请将所有 StudioCMS 配置选项移至此文件,如下所示: + +### 文件结构示例 + + + +- .env +- astro.config.mjs +- **studiocms.config.mjs** +- studiocms-auth.config.json 自动生成 +- package.json +- src + - env.d.ts + - ... + + + +### 配置文件示例 + +```ts twoslash title="astro.config.mjs" +import db from '@astrojs/db'; +import node from '@astrojs/node'; +import studioCMS from 'studiocms'; +import { defineConfig } from 'astro/config'; + +export default defineConfig({ + site: 'https://demo.studiocms.dev/', + output: 'server', + adapter: node({ mode: "standalone" }), + integrations: [ db(), studioCMS() ], +}); +``` + +```ts twoslash title="studiocms.config.mjs" +import { defineStudioCMSConfig } from "studiocms/config"; + +export default defineStudioCMSConfig({ + dbStartPage: false, + // 其他配置选项 +}) +``` + +{/* 文档链接 */} +[reference-page]: /zh-cn/config-reference/ \ No newline at end of file diff --git a/src/content/docs/zh-cn/start-here/environment-variables.mdx b/src/content/docs/zh-cn/start-here/environment-variables.mdx new file mode 100644 index 00000000..717bb6f8 --- /dev/null +++ b/src/content/docs/zh-cn/start-here/environment-variables.mdx @@ -0,0 +1,110 @@ +--- +i18nReady: true +title: 环境变量配置 +description: StudioCMS 所需环境变量概览 +sidebar: + order: 2 +--- + +import { Aside } from '@astrojs/starlight/components'; +import ReadMore from '~/components/ReadMore.astro'; + +为使 StudioCMS 正常运行,必须正确配置相关环境变量。这些变量对于建立与 Astro DB 的安全连接以及 StudioCMS API 的认证至关重要。若未正确配置这些环境变量,应用程序将无法正常运行。 + +您可以在项目根目录下创建 `.env` 文件并添加所需的环境变量。`.env` 文件是一个包含键值对的环境变量文本文件,应用程序在运行时将读取这些变量。 + +有关在 Astro 中使用环境变量的更多信息,请参考 Astro 文档中的[环境变量指南](https://docs.astro.build/guides/environment-variables)。 + +## 必需环境变量 + +### `@astrojs/db` 数据库连接参数 + +- `ASTRO_DB_REMOTE_URL` - libSQL 服务器的连接 URL +- `ASTRO_DB_APP_TOKEN` - libSQL 服务器的应用令牌 + +```bash title=".env" +ASTRO_DB_REMOTE_URL=libsql://your.server.io +ASTRO_DB_APP_TOKEN=eyJh...RUCg +``` + +有关 `@astrojs/db` 的详细信息,请参阅 [Astro DB 文档](https://docs.astro.build/en/guides/astro-db/) + +### `@studiocms/auth` 加密密钥 + +`CMS_ENCRYPTION_KEY` - 用于加密敏感数据的安全密钥 + +```bash title=".env" +CMS_ENCRYPTION_KEY="wqR+w...sRcg==" +``` + + + +## 可选环境变量 + +### oAuth 认证环境变量 + + +有关 oAuth 认证的详细配置指南,请参阅[配置 oAuth 认证][config-oauth]文档。 + + +#### GitHub(可选) + +如需启用 GitHub 认证,请在 `.env` 文件中添加: + +```bash title=".env" +# GitHub OAuth 凭据 +CMS_GITHUB_CLIENT_ID= +CMS_GITHUB_CLIENT_SECRET= +CMS_GITHUB_REDIRECT_URI= +``` + + + +#### Discord(可选) + +```bash title=".env" +# Discord OAuth 凭据 +CMS_DISCORD_CLIENT_ID= +CMS_DISCORD_CLIENT_SECRET= +CMS_DISCORD_REDIRECT_URI= +``` + +#### Google(可选) + +```bash title=".env" +# Google OAuth 凭据 +CMS_GOOGLE_CLIENT_ID= +CMS_GOOGLE_CLIENT_SECRET= +CMS_GOOGLE_REDIRECT_URI= +``` + +#### Auth0(可选) + +```bash title=".env" +# Auth0 OAuth 凭据 +CMS_AUTH0_CLIENT_ID= +CMS_AUTH0_CLIENT_SECRET= +CMS_AUTH0_DOMAIN= +CMS_AUTH0_REDIRECT_URI= +``` + +### 图像服务环境变量 + +#### Cloudinary(可选) + +如需使用内置的 Cloudinary 插件,需配置以下变量: + +```bash title=".env" +## Cloudinary JavaScript SDK +CMS_CLOUDINARY_CLOUDNAME="demo" +``` + +{/* 文档链接 */} +[config-oauth]: /zh-cn/start-here/getting-started/#optional-configure-oauth-authentication \ No newline at end of file diff --git a/src/content/docs/zh-cn/start-here/gallery.mdx b/src/content/docs/zh-cn/start-here/gallery.mdx new file mode 100644 index 00000000..6520c290 --- /dev/null +++ b/src/content/docs/zh-cn/start-here/gallery.mdx @@ -0,0 +1,15 @@ +--- +i18nReady: true +title: 图库展示 +description: 展示 StudioCMS 功能的图片画廊 +tableOfContents: false +sidebar: + order: 5 +--- + +import Gallery from '~/components/Gallery.astro' +import { mainDemoGalleryImages } from "~/assets/index.ts" + +这里展示了 StudioCMS 集成的功能截图: + + \ No newline at end of file diff --git a/src/content/docs/zh-cn/start-here/getting-started.mdx b/src/content/docs/zh-cn/start-here/getting-started.mdx new file mode 100644 index 00000000..aa3988c8 --- /dev/null +++ b/src/content/docs/zh-cn/start-here/getting-started.mdx @@ -0,0 +1,346 @@ +--- +i18nReady: true +title: 快速入门指南 +description: 开始使用 StudioCMS 进行开发 +sidebar: + order: 1 +--- + +import { PackageManagers } from 'starlight-package-managers' +import TursoCLI from '~/components/TursoCLI.astro'; +import { Aside, Steps, Tabs, TabItem, LinkCard } from '@astrojs/starlight/components'; +import ReadMore from '~/components/ReadMore.astro'; +import { sponsors, SponsorLink } from '~/share-link' + + + +## 开始前的准备工作 + +使用 StudioCMS 需要满足以下条件: + +- 支持 Astro 的 [Node.js 版本](https://docs.astro.build/en/install-and-setup/#prerequisites)(不支持 Bun 和 Deno) +- 一个 Astro 项目 +- libSQL 数据库提供商或[自托管 libSQL 服务器][self-hosted-libsql] +- StudioCMS 集成 + +## 准备数据库 + +StudioCMS 使用 `@astrojs/db` 连接您的 libSQL 数据库。您可以选择任何 libSQL 提供商或[自托管 libSQL 服务器][self-hosted-libsql]。 + +如果您使用 StudioCMS CLI,并且已安装 Turso CLI,可以跳过此步骤,直接使用 CLI 创建新数据库。 + +有关所需环境变量的详细信息,请参阅 [`@astrojs/db` 数据库连接参数][db-url-token] + +### 使用 Turso 快速入门 + + + + +1. 安装 +2. Turso 账号 +3. 创建新数据库 + +4. 获取并设置 `ASTRO_DB_REMOTE_URL` + + 4a. 运行 `show` 命令查看数据库信息: + + + 4b. 复制 URL 值并设置为 `ASTRO_DB_REMOTE_URL`: + ```bash title=".env" + ASTRO_DB_REMOTE_URL=libsql://studiocms-yourname.turso.io + ``` + +5. 获取并设置 `ASTRO_DB_APP_TOKEN` + + 5a. 创建新令牌用于数据库认证: + + + 5b. 复制命令输出并设置为 `ASTRO_DB_APP_TOKEN`: + ```bash title=".env" + ASTRO_DB_APP_TOKEN=eyJhbGciOiJF...3ahJpTkKDw + ``` + + + +现在可以继续设置您的 StudioCMS 项目了! + +### 使用其他提供商或自托管 libSQL + +libSQL 同时支持 HTTP 和 WebSockets 作为远程服务器的传输协议,也支持本地文件或内存数据库。 + +有关所需环境变量的详细信息,请参阅[数据库连接参数][db-url-token] + +了解所有 libSQL 选项(包括本地文件),请参阅 [Astro 文档:远程 URL 配置选项](https://docs.astro.build/en/guides/astro-db/#remote-url-configuration-options) + +## 创建 StudioCMS 项目 + + + + + + 1. 使用 create 命令创建 StudioCMS 项目 + + 使用预置模板创建包含 StudioCMS 的 Astro 项目: + + + 运行命令后,将提示您回答几个项目相关问题。完成后,CLI 将在指定目录创建新的 Astro 项目。 + + 随后系统会提示您完成后续步骤,包括确保环境变量正确设置以及运行项目完成安装。 + + 2. 运行 CLI 后,请确保 `astro.config.mjs` 文件正确配置: + + ```ts twoslash title="astro.config.mjs" {2-4,11-12} + import { defineConfig } from 'astro/config'; + import db from '@astrojs/db'; + import node from '@astrojs/node'; + import studioCMS from 'studiocms'; + + export default defineConfig({ + site: 'https://demo.studiocms.dev/', + output: 'server', + adapter: node({ mode: "standalone" }), + integrations: [ + db(), + studioCMS(), + ], + }); + ``` + + + + + + 1. 创建新的 Astro 项目 + + 创建基本的 Astro 项目: + + + 运行命令后,将提示您回答几个项目相关问题。完成后,CLI 将在指定目录创建新的 Astro 项目。 + + 您将看到 "Liftoff confirmed. Explore your project!" 消息及后续步骤建议。 + + `cd` 进入新项目目录: + ```bash + cd my-project + ``` + + 如果在 CLI 向导中跳过了 npm 安装步骤,请确保在继续前安装依赖。 + + 2. 安装 StudioCMS 集成及其依赖: + + + 3. 更新 `astro.config.mjs` 文件: + ```ts twoslash title="astro.config.mjs" {2-4,11-12} + import { defineConfig } from 'astro/config'; + import db from '@astrojs/db'; + import node from '@astrojs/node'; + import studioCMS from 'studiocms'; + + export default defineConfig({ + site: 'https://demo.studiocms.dev/', + output: 'server', + adapter: node({ mode: "standalone" }), + integrations: [ + db(), + studioCMS(), + ], + }); + ``` + + + + + + 1. 创建新的 Astro 项目 + + 创建基本的 Astro 项目: + + + 运行命令后,将提示您回答几个项目相关问题。完成后,CLI 将在指定目录创建新的 Astro 项目。 + + 您将看到 "Liftoff confirmed. Explore your project!" 消息及后续步骤建议。 + + `cd` 进入新项目目录: + ```bash + cd my-project + ``` + + 如果在 CLI 向导中跳过了 npm 安装步骤,请确保在继续前安装依赖。 + + 2. 手动安装 StudioCMS 集成和依赖: + + + 3. 更新 `astro.config.mjs` 文件: + ```ts twoslash title="astro.config.mjs" {2-4,11-12} + import { defineConfig } from 'astro/config'; + import db from '@astrojs/db'; + import node from '@astrojs/node'; + import studioCMS from 'studiocms'; + + export default defineConfig({ + site: 'https://demo.studiocms.dev/', + output: 'server', + adapter: node({ mode: "standalone" }), + integrations: [ + db(), + studioCMS(), + ], + }); + ``` + + + + + +> **重要提示**: +> 1. `astro.config.mjs` 文件中的 `site` 选项是必需的。可以设置为站点 URL 或占位符 URL(例如 `https://demo.studiocms.dev/` 或 `http://localhost:4321/`) +> 2. StudioCMS 需要 [Astro 适配器](https://docs.astro.build/en/guides/on-demand-rendering/#server-adapters),确保在 `astro.config.mjs` 文件中设置了支持 SSR 路由的适配器 + +## 配置认证 + +StudioCMS 认证需要至少在 `.env` 文件中设置[加密密钥][encryption-key]。 + +以下是 StudioCMS 认证所需的环境变量: + +```bash title=".env" +# 用于用户名密码认证的加密密钥 +CMS_ENCRYPTION_KEY="wqR+w...sRcg==" +``` + +使用以下命令生成安全加密密钥: +```bash +openssl rand --base64 16 +``` +并将输出设置为 `CMS_ENCRYPTION_KEY` 的值。 + + +了解所有可用的认证环境变量,请参阅[环境变量][environment-variables]页面。 + + +### 可选:配置 oAuth 认证 + +StudioCMS 支持 GitHub、Discord、Google 和 Auth0 的 oAuth 认证。要配置 oAuth,需要[在 `.env` 文件中设置必需的环境变量][oauth-environment-variables],并确保[在配置中启用了相应的提供商][auth-config-ref]。 + +oAuth 提供商需要设置回调 URL(用户认证后的重定向路径)。 + +#### 设置回调 URL + +根据您的环境设置回调 URL: + +| 环境 | 回调 URL | +|------------|------------------------------------------| +| 生产环境 | `https://your-domain.tld/studiocms_api/auth//callback` | +| 测试开发 | `http://localhost:4321/studiocms_api/auth//callback` | + +#### 回调 URL 路径示例 + +不同提供商对应的回调 URL 路径: + +| 提供商 | 回调 PATH | +|----------|-----------------------------------| +| GitHub | `/studiocms_api/auth/github/callback` | +| Discord | `/studiocms_api/auth/discord/callback` | +| Google | `/studiocms_api/auth/google/callback` | +| Auth0 | `/studiocms_api/auth/auth0/callback` | + +## 配置 `package.json` 脚本 + +在 `package.json` 脚本中添加 `--remote` 参数: + +```json /--remote/ title="package.json" +{ + "name": "my-studiocms-project", + "scripts": { + "dev": "astro dev --remote", + "build": "astro check & astro build --remote", + "astro": "astro" + } +} +``` + +## 运行 StudioCMS 项目 + +得益于 Astro 的强大功能,StudioCMS 的运行非常简单。 + +### 首次设置(或数据表结构更新时) + +在终端运行以下命令: + + + + + + +运行命令后,您将看到项目在 `localhost:4321` 运行的消息。首次设置时,请访问 `http://localhost:4321/start` 完成 StudioCMS 配置。 + +### 本地 Astro 开发模式运行 + +在终端运行以下命令: + + + +运行后,访问 `http://localhost:4321` 查看您的项目。 + +**恭喜!** 🥳 您已成功在 Astro 项目中安装 StudioCMS。 + +### 为 StudioCMS 添加前端 + +StudioCMS 是无头 CMS,您需要自行创建前端展示内容。如果需要预构建的前端,请查看[包目录][package-catalog]中的插件。 + +#### 设置博客 + +如需搭建博客,可以使用 `@studiocms/blog` 插件: + + + +安装后,在 `studiocms.config.mjs` 文件中添加插件: + +```ts twoslash title="studiocms.config.mjs" +import { defineStudioCMSConfig } from 'studiocms/config'; +import blog from '@studiocms/blog'; + +export default defineStudioCMSConfig({ + dbStartPage: false, + plugins: [ + blog(), + ], +}); +``` + +### 构建和部署 StudioCMS 项目 + +完成[首次设置](#first-time-setup-or-during-updates-if-the-tables-schema-is-updated)后,即可构建并部署项目到服务器。 + +默认情况下,StudioCMS 仪表板位于 `http://your-domain.tld/dashboard`。 + +该仪表板可用于在开发和生产环境中管理内容和设置。 + +> **建议**:在生产模式下使用 StudioCMS,开发模式下仪表板可能出现问题(如 Vite 依赖错误)。 + +## 后续步骤 + + +了解如何设置 StudioCMS 的[环境变量][environment-variables]。 + + + +查看[包目录][package-catalog],寻找和使用 StudioCMS 插件。 + + + +通过 [StudioCMS 参考文档][config-reference] 了解配置选项。 + + +{/* 文档链接 */} +[package-catalog]: /zh-cn/package-catalog/ +[environment-variables]: /zh-cn/start-here/environment-variables/ +[config-reference]: /zh-cn/config-reference/ +[db-url-token]: /zh-cn/start-here/environment-variables/#database-url-and-token-for-astrojsdb +[encryption-key]: /zh-cn/start-here/environment-variables/#encryption-key-for-studiocmsauth +[oauth-environment-variables]: /zh-cn/start-here/environment-variables/#oauth-authentication-environment-variables +[auth-config-ref]: /zh-cn/config-reference/dashboard/#authconfig +[self-hosted-libsql]: /zh-cn/guides/database/sqld-server/ \ No newline at end of file diff --git a/src/content/docs/zh-cn/start-here/why-studioCMS.mdx b/src/content/docs/zh-cn/start-here/why-studioCMS.mdx new file mode 100644 index 00000000..85e65e72 --- /dev/null +++ b/src/content/docs/zh-cn/start-here/why-studioCMS.mdx @@ -0,0 +1,36 @@ +--- +i18nReady: true +title: 为什么选择 StudioCMS? +description: StudioCMS 是传统 CMS 平台的创新替代方案,基于 Astro DB 和 Astro 的无头 CMS,提供无缝的内容管理体验。 +sidebar: + order: 4 +--- + +Astro 是一个以内容为核心的框架。其内容集合(content collections)和全新内容层等功能,使得管理任何规模或形式的内容变得极其简单。 + +然而,这种解决方案要求您必须具备开发者身份,或者至少对 Astro 如何处理内容目录中的文件有深入了解。这种体验并不适合客户或普通用户,他们只需要简单的内容管理界面。这正是您需要 CMS 的原因。 + +市面上存在各种满足不同需求的 CMS 解决方案,但没有一个能完全发挥 Astro 的全部潜力。这正是 StudioCMS 诞生的意义:它是一个完全专注于 Astro 的 CMS,能够深入整合 Astro 的每个功能特性,提供高度优化的开发者体验(DX)。 + +## 核心优势 + +- **`@astrojs/db`深度整合**: + 基于 Astro DB 构建,您可以选择数据存储位置和方式,无论是 Turso 云数据库还是本地文件。 + +- **可定制 Markdown 渲染器**: + 内置支持主题化提示框(callouts)和可自定义样式的 Markdown 渲染器。 + +- **开箱即用的认证系统**: + 完整的认证解决方案,内置密码加密、会话管理、速率限制和可自定义的权限等级。 + +- **WordPress 无缝迁移**: + 支持从任何标准 WordPress 安装轻松迁移到 StudioCMS! + +- **插件化架构**: + 可扩展的插件系统,支持自定义页面类型、仪表板部件和设置页面。 + +- **智能内容渲染**: + 内置可定制的内容渲染能力,支持主题化提示框和 Markdown 样式控制。 + +- **持续创新**: + StudioCMS 正在积极开发中!我们将持续添加新功能,优化您的内容体验。欢迎[提交问题](https://github.com/withstudiocms/studiocms/issues/new/choose)提出建议或反馈! \ No newline at end of file diff --git a/src/content/docs/zh-cn/utils/rendering.mdx b/src/content/docs/zh-cn/utils/rendering.mdx new file mode 100644 index 00000000..a8be9f49 --- /dev/null +++ b/src/content/docs/zh-cn/utils/rendering.mdx @@ -0,0 +1,38 @@ +--- +i18nReady: true +title: "内容渲染" +description: "内容渲染选项" +sidebar: + order: 1 +--- + +StudioCMS 的渲染系统根据当前页面类型(pageType)动态确定。 + +以下示例展示了一个通配路由(Catch-all route),其中通过 SDK 获取当前页面数据并传递给渲染器。在此示例中,我们使用页面设置中默认配置的 `studiocms/markdown` 页面类型,并将其包裹在布局组件中(如 `@studiocms/blog` 插件的实现方式)。某些页面构建器插件可能不包含标准布局,而是允许您像其他 CMS 系统一样完全在构建器中设计页面。 + +```astro title="src/pages/[...slug].astro" +--- +import { StudioCMSRenderer } from 'studiocms:renderer'; +import studioCMS_SDK from 'studiocms:sdk'; +import Layout from '../layouts/Layout.astro'; + +let { slug } = Astro.params; + +if (!slug) { + slug = 'index'; +} + +const page = await studioCMS_SDK.GET.databaseEntry.pages.bySlug(slug); + +if (!page) { + return Astro.redirect('/404'); +} + +const { title, description, heroImage } = page; +--- + + +
+ +
+
\ No newline at end of file diff --git a/src/starlight-sidebar/zh-cn.json b/src/starlight-sidebar/zh-cn.json new file mode 100644 index 00000000..eccc5d7a --- /dev/null +++ b/src/starlight-sidebar/zh-cn.json @@ -0,0 +1,21 @@ + "topic-package-catalog": "包目录", + "topic-references": "参考文档", + "start-here": "入门指南", + "contributing": "贡献指南", + "how-it-works": "核心机制", + "utils": "工具与助手", + "plugins": "插件", + "catalog": "目录", + "studiocms-plugins": "StudioCMS 官方插件", + "community-plugins": "社区插件", + "config-reference": "配置参考", + "typedoc": "TypeDoc", + "auto-gen": "自动生成", + "topic-guides": "教程指南", + "database": "数据库指南", + "upgrade": "版本升级", + "version": "版本指南", + "upgrade": "版本升级", + "version": "版本指南", + "latest": "最新升级指南" +} \ No newline at end of file From 1ae4231c3d9d790b61ab92dbcc3d845ea747839d Mon Sep 17 00:00:00 2001 From: Jenxi Date: Tue, 3 Jun 2025 20:17:12 +0800 Subject: [PATCH 03/25] Update availTranslations.ts Added zh-CN --- src/starlight-sidebar/availTranslations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/starlight-sidebar/availTranslations.ts b/src/starlight-sidebar/availTranslations.ts index b4cb9dc2..69aafc24 100644 --- a/src/starlight-sidebar/availTranslations.ts +++ b/src/starlight-sidebar/availTranslations.ts @@ -1 +1 @@ -export const Translations = ['en', 'es', 'fr', 'ko', 'de'] as const; +export const Translations = ['en', 'es', 'fr', 'ko', 'de', 'zh-cn'] as const; From b8a5e8f15883f0e2a7ba9b80dbcc42d4f01bfcee Mon Sep 17 00:00:00 2001 From: Jenxi Date: Thu, 5 Jun 2025 19:52:23 +0800 Subject: [PATCH 04/25] Fixed missing tag --- src/starlight-sidebar/zh-cn.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/starlight-sidebar/zh-cn.json b/src/starlight-sidebar/zh-cn.json index eccc5d7a..82f80174 100644 --- a/src/starlight-sidebar/zh-cn.json +++ b/src/starlight-sidebar/zh-cn.json @@ -1,3 +1,5 @@ +{ + "topic-learn": "学习", "topic-package-catalog": "包目录", "topic-references": "参考文档", "start-here": "入门指南", @@ -15,7 +17,5 @@ "database": "数据库指南", "upgrade": "版本升级", "version": "版本指南", - "upgrade": "版本升级", - "version": "版本指南", "latest": "最新升级指南" } \ No newline at end of file From 6ef2cc2b4a388c8fbd81aca33db1dd29ffe0dcda Mon Sep 17 00:00:00 2001 From: Jenxi Date: Thu, 5 Jun 2025 20:37:03 +0800 Subject: [PATCH 05/25] Delete release-notes.md No translation needed since it's auto-generated --- .../zh-cn/guides/upgrade/release-notes.md | 742 ------------------ 1 file changed, 742 deletions(-) delete mode 100644 src/content/docs/zh-cn/guides/upgrade/release-notes.md diff --git a/src/content/docs/zh-cn/guides/upgrade/release-notes.md b/src/content/docs/zh-cn/guides/upgrade/release-notes.md deleted file mode 100644 index c00b8028..00000000 --- a/src/content/docs/zh-cn/guides/upgrade/release-notes.md +++ /dev/null @@ -1,742 +0,0 @@ ---- -# Warning: This file is generated automatically. Do not edit! -i18nReady: false -title: Release Notes -type: integration -catalogEntry: studiocms -replaceTitle: false -description: Release notes for the studiocms package. -editUrl: false -sidebar: - badge: - text: Auto Generated - variant: tip ---- - -The following is automated release notes for the `studiocms` package. -For more information, see the [Changelog file](https://github.com/withstudiocms/studiocms/blob/main/packages/studiocms/CHANGELOG.md) - -## 0.1.0-beta.18 - -- [#585](https://github.com/withstudiocms/studiocms/pull/585) [`3226347`](https://github.com/withstudiocms/studiocms/commit/32263470412a3196f1ed9dca6bd5cfb8fe5f258a) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): update dependency nodemailer to v7 - -- [#588](https://github.com/withstudiocms/studiocms/pull/588) [`4b6719b`](https://github.com/withstudiocms/studiocms/commit/4b6719b27fbe696c2568ba4ba10600cda23790a8) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix gen-jwt CLI command - -- [#583](https://github.com/withstudiocms/studiocms/pull/583) [`3198db5`](https://github.com/withstudiocms/studiocms/commit/3198db594e22d15e05300c29c12294c2182f10c0) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement new StudioCMS hook-based plugin system - -## 0.1.0-beta.17 - -- [#576](https://github.com/withstudiocms/studiocms/pull/576) [`a09257f`](https://github.com/withstudiocms/studiocms/commit/a09257ffe9fca4226af031113e427f472d6057db) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - replace lodash with deepmerge-ts - -- [#573](https://github.com/withstudiocms/studiocms/pull/573) [`77bd274`](https://github.com/withstudiocms/studiocms/commit/77bd274b33801e06946b3f8bcdb32ed7e950ae78) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update CLI hashing utils - -- [#581](https://github.com/withstudiocms/studiocms/pull/581) [`63eb2dd`](https://github.com/withstudiocms/studiocms/commit/63eb2dd922eee45542572e93a09bb1be49d2c9c3) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement new feedback system in the dashboard - -- [#580](https://github.com/withstudiocms/studiocms/pull/580) [`1662095`](https://github.com/withstudiocms/studiocms/commit/166209597fcd22b887dac9b9612e4f85e1ecc91a) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Optimize promises in middleware and update how permission levels are being processed - -- [#577](https://github.com/withstudiocms/studiocms/pull/577) [`e609592`](https://github.com/withstudiocms/studiocms/commit/e6095923d5d8b97e92854062e03e31785c74e542) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fix Astro Fonts - -- [#575](https://github.com/withstudiocms/studiocms/pull/575) [`bd3b571`](https://github.com/withstudiocms/studiocms/commit/bd3b5714645a52b9f353754463ab64d59590a4be) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update keyfile path detection - -## 0.1.0-beta.16 - -- [#563](https://github.com/withstudiocms/studiocms/pull/563) [`1256340`](https://github.com/withstudiocms/studiocms/commit/1256340864ede18cf1e066011b87e13cc16d1c9e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement new CLI functionality to generate JWT tokens usable for custom sqld servers - -- [#571](https://github.com/withstudiocms/studiocms/pull/571) [`ec92a2b`](https://github.com/withstudiocms/studiocms/commit/ec92a2b52588c0db6feca08bc2792cd7701db79e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update password system - -- [#557](https://github.com/withstudiocms/studiocms/pull/557) [`0536040`](https://github.com/withstudiocms/studiocms/commit/05360407c40674fd6045468a322f066a7284c6c9) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement new CLI command for StudioCMS - - There is now a `studiocms add ` command that allows you to add plugins to studiocms easily! - -- [#569](https://github.com/withstudiocms/studiocms/pull/569) [`e6276f3`](https://github.com/withstudiocms/studiocms/commit/e6276f3389225109aeda015f9ed77b99a69b3239) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix editing users for cli - -- [#566](https://github.com/withstudiocms/studiocms/pull/566) [`1b63cc5`](https://github.com/withstudiocms/studiocms/commit/1b63cc5ad70b50c8c7ff8679bd0e390651b1c2b3) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - migrate cli to utilize @withstudiocms/cli-kit - -- [#568](https://github.com/withstudiocms/studiocms/pull/568) [`1f5c3d7`](https://github.com/withstudiocms/studiocms/commit/1f5c3d7f3b9ae9094b06cd3092c04da9af0b5106) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update to Astro v5.7 and Implement new Astro Fonts feature - -## 0.1.0-beta.15 - -- [#553](https://github.com/withstudiocms/studiocms/pull/553) [`ae8cdfc`](https://github.com/withstudiocms/studiocms/commit/ae8cdfcb7f02e4f0d520fd91d0a295a22f05f421) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #553) - -- [#544](https://github.com/withstudiocms/studiocms/pull/544) [`83a05db`](https://github.com/withstudiocms/studiocms/commit/83a05db9d05cd88e2a49bc31f5bee20de8a39cd8) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Optimized data processing with concurrent operations, resulting in faster content rendering and improved responsiveness. - -- [#510](https://github.com/withstudiocms/studiocms/pull/510) [`6944793`](https://github.com/withstudiocms/studiocms/commit/69447937e7379242749a321d71ddd924302560dc) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #510) - -- [#531](https://github.com/withstudiocms/studiocms/pull/531) [`ec4530b`](https://github.com/withstudiocms/studiocms/commit/ec4530bac62e192a4abc34826c2a67c57290de2e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix bug with page creation and cache - -- [#522](https://github.com/withstudiocms/studiocms/pull/522) [`de1dbec`](https://github.com/withstudiocms/studiocms/commit/de1dbec5590518753aa3fee6db6e6cd060327fa2) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fix SDK JWT generation and verification - -- [#512](https://github.com/withstudiocms/studiocms/pull/512) [`cd10407`](https://github.com/withstudiocms/studiocms/commit/cd1040779926a55db63ceb6ac1b9ddacb23330a8) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update to utilize new `@withstudiocms/buildkit` for build and dev - -- [#552](https://github.com/withstudiocms/studiocms/pull/552) [`1ee31e6`](https://github.com/withstudiocms/studiocms/commit/1ee31e6840b05a1619b2959572d484cff8f0116d) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - tweak sidebar css - -- [#556](https://github.com/withstudiocms/studiocms/pull/556) [`13f2d99`](https://github.com/withstudiocms/studiocms/commit/13f2d994956488daa7fe5bc9e1597b82cdb165c7) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - update script to send proper response - -- [#528](https://github.com/withstudiocms/studiocms/pull/528) [`d3674d6`](https://github.com/withstudiocms/studiocms/commit/d3674d618141924e88568bb7540debd97f3eaa77) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #528) - -- [#511](https://github.com/withstudiocms/studiocms/pull/511) [`c3d0b1e`](https://github.com/withstudiocms/studiocms/commit/c3d0b1e2d083057fc9ec2775dabd029b9dfd7e72) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update default `en-us` language code to `en` - -- [#549](https://github.com/withstudiocms/studiocms/pull/549) [`9199097`](https://github.com/withstudiocms/studiocms/commit/9199097fc20ca40b4716e57230fdc585af542167) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update dependencies (Support Astro v5.6) - -- [#539](https://github.com/withstudiocms/studiocms/pull/539) [`a4ab614`](https://github.com/withstudiocms/studiocms/commit/a4ab614954e05d541a8e09178370669a8e501212) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - feat(sdk): add pagination support to folderPages and getAllPages functions - -- [#536](https://github.com/withstudiocms/studiocms/pull/536) [`301ab9f`](https://github.com/withstudiocms/studiocms/commit/301ab9f1ef8da10001536de1634d330400a4fea3) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - bugfix: Verify user has the correct permissions before allowing user modification. - -- [#543](https://github.com/withstudiocms/studiocms/pull/543) [`a7dc2ad`](https://github.com/withstudiocms/studiocms/commit/a7dc2ad764fb73432c7a6c00986d7f353a871f4b) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #543) - -- [#514](https://github.com/withstudiocms/studiocms/pull/514) [`0d0fbd6`](https://github.com/withstudiocms/studiocms/commit/0d0fbd6c13fc3e836bee7724d95ef3a63ce3f714) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix webvitals plugin translations for dashboard page - -- [#527](https://github.com/withstudiocms/studiocms/pull/527) [`c900ab8`](https://github.com/withstudiocms/studiocms/commit/c900ab85a5c74e52865e7086a5e851d7f1836e4c) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix(dashboard): fix css for two dashboard grid components that in some browsers would show the wrong color - -- [#529](https://github.com/withstudiocms/studiocms/pull/529) [`089dcc3`](https://github.com/withstudiocms/studiocms/commit/089dcc30df37ccecb5903ebeedf81844b34be8f7) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Add the ability to both update the Avatar URL, and sync with Libravatar Avatar service. - -- [#537](https://github.com/withstudiocms/studiocms/pull/537) [`97bbfc8`](https://github.com/withstudiocms/studiocms/commit/97bbfc8263152c774d7bce20005070273789ca3c) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix: components in componentRegistry can now have names such as `test-comp` - -- [#530](https://github.com/withstudiocms/studiocms/pull/530) [`7ed3f39`](https://github.com/withstudiocms/studiocms/commit/7ed3f391bc6a67a6891f7a4cf7c3e1ecf171aff6) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #530) - -- [#517](https://github.com/withstudiocms/studiocms/pull/517) [`b710b58`](https://github.com/withstudiocms/studiocms/commit/b710b5859625597b14c30fd4c386fcc3d88dae71) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement CLI utils for user management - -- [#538](https://github.com/withstudiocms/studiocms/pull/538) [`6b83369`](https://github.com/withstudiocms/studiocms/commit/6b8336988c00c8cfe4254c0e454d6ddbc9a145c1) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - refactor createPage logic to allow for draft pages and published pages correctly - -- [#525](https://github.com/withstudiocms/studiocms/pull/525) [`ea82076`](https://github.com/withstudiocms/studiocms/commit/ea82076651a09cdebb13082c627074909b919f44) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update SDK to allow getting pages by folder, add support to only return the page metadata, and add author and contributor data to page metadata. - -- [#524](https://github.com/withstudiocms/studiocms/pull/524) [`e2aa9d3`](https://github.com/withstudiocms/studiocms/commit/e2aa9d3a56985403cd4810e47ce823def2ad86eb) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix version cache generation - -- [#545](https://github.com/withstudiocms/studiocms/pull/545) [`10d64cf`](https://github.com/withstudiocms/studiocms/commit/10d64cfa7fdd6f85fd6af099081675acdea58a92) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - More route optimizations, moving variables that are called on multiple pages/endpoints to middleware - -## 0.1.0-beta.14 - -- [#505](https://github.com/withstudiocms/studiocms/pull/505) [`ae5176d`](https://github.com/withstudiocms/studiocms/commit/ae5176dd683c0abc5b997c2e5f5935df5eb7d33e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor StudioCMS and remove dependencies, - - - `package-json` is now removed, as we have an included function to get the latest version from npm directly. (much simpler interface) - - Move functionality from `@matthiesenxyz/integrationUtils` for checkIfUnsafe() util, since that is the only util we are using, into StudioCMS. removing the need for this dep all together - -- [#500](https://github.com/withstudiocms/studiocms/pull/500) [`1e61e13`](https://github.com/withstudiocms/studiocms/commit/1e61e13c2d7d02a4d00f733a268884904a644e37) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #500) - -- [#507](https://github.com/withstudiocms/studiocms/pull/507) [`4d42b42`](https://github.com/withstudiocms/studiocms/commit/4d42b4289ce43f2812fbb80913485db8a300163e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor SDK and page scripts - - - SDK cache is now busted when it should be - - Content management page sidebar now refreshes - - You can now hide the default index in the siteConfig on the dashboard - - ### NOTICE (non-breaking schema update) - - - You will need to push the new schema `astro db push --remote` - -- [#503](https://github.com/withstudiocms/studiocms/pull/503) [`55663b2`](https://github.com/withstudiocms/studiocms/commit/55663b243fd516ed77a90987b9768f82184c180b) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #503) - -- [#506](https://github.com/withstudiocms/studiocms/pull/506) [`b26cfb5`](https://github.com/withstudiocms/studiocms/commit/b26cfb58f19c1b571a1395a6bc6c6d3963e0a19a) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Export runtime functions in package.json for plugins to use. - -- [#496](https://github.com/withstudiocms/studiocms/pull/496) [`f45607e`](https://github.com/withstudiocms/studiocms/commit/f45607e2efc61242db96d5cc9a408e9af27d7650) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update responses for username or password when invalid - -- [#492](https://github.com/withstudiocms/studiocms/pull/492) [`7d14e58`](https://github.com/withstudiocms/studiocms/commit/7d14e583406c2afcbd398d4c7da2187ba79a840c) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #492) - -- [#495](https://github.com/withstudiocms/studiocms/pull/495) [`62ee6fc`](https://github.com/withstudiocms/studiocms/commit/62ee6fc4a3afc7a57470e3a72d8ec61785d39a18) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #495) - -- [#504](https://github.com/withstudiocms/studiocms/pull/504) [`055824c`](https://github.com/withstudiocms/studiocms/commit/055824c6a5a52b74ed169050745328bdac07e6bb) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Introduce new JWT Token system to reduce dependencies - -## 0.1.0-beta.13 - -- [#484](https://github.com/withstudiocms/studiocms/pull/484) [`48630ef`](https://github.com/withstudiocms/studiocms/commit/48630ef21bac514baa23aeb07d4fbf6fd09fb909) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #484) - -- [#483](https://github.com/withstudiocms/studiocms/pull/483) [`3612916`](https://github.com/withstudiocms/studiocms/commit/3612916cf393488e4ba850312cc0a8ce27fd9122) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fix Missing CSS on DB start pages for the code blocks - -- [#489](https://github.com/withstudiocms/studiocms/pull/489) [`77f89d6`](https://github.com/withstudiocms/studiocms/commit/77f89d6ecec0f06ffdb03bb8b86e99880345ee48) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update dependencies - -- [#490](https://github.com/withstudiocms/studiocms/pull/490) [`5780894`](https://github.com/withstudiocms/studiocms/commit/578089449210d017748df5fd27b34569a6899ce0) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #490) - -- [#476](https://github.com/withstudiocms/studiocms/pull/476) [`a430661`](https://github.com/withstudiocms/studiocms/commit/a4306618aeb3479f9d7b074637a54dc65798fe78) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix(auth): Re-enable the verification for usernames and passwords to ensure data safety - -- [#474](https://github.com/withstudiocms/studiocms/pull/474) [`4fc5d6b`](https://github.com/withstudiocms/studiocms/commit/4fc5d6b9528968d7681dbf2f549e844989e10eb5) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor internal integration logic to cleanup old logic and simplify main integration - -- [#480](https://github.com/withstudiocms/studiocms/pull/480) [`3f8b220`](https://github.com/withstudiocms/studiocms/commit/3f8b220a118b7829d9680b579fc50dd379d25c4b) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - NEW: HTML pageType available for pages, build HTML pages with the new SunEditor HTML builder. - -- [#488](https://github.com/withstudiocms/studiocms/pull/488) [`501d11c`](https://github.com/withstudiocms/studiocms/commit/501d11cb41dd89e0280eecba9db57a49fce260a5) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #488) - -- [#485](https://github.com/withstudiocms/studiocms/pull/485) [`ab1714c`](https://github.com/withstudiocms/studiocms/commit/ab1714ce7d89560c545b42601c888a004941f992) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update Diff page - - - Update pageMetaData section to use disabled inputs to display previous/current data - - Implement diff endpoint for reverting changes - - Add interactive buttons for reverting changes - - Add helpful information to the top section to display info about the diff - -- [#477](https://github.com/withstudiocms/studiocms/pull/477) [`0901215`](https://github.com/withstudiocms/studiocms/commit/0901215cf33b7e0283c1b31265038fd15efd7dfb) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Remove old `testingAndDemoMode` developer option and add new `demoMode` option with a simple interface - - Demo mode can either be `false` or an object with the following type `{ username: string; password: string; }`. This will allow you to create demo user credentials that are public. - - Please note, this does not prevent changes and resetting the DB is up to the developer to configure on their own. (a github action that clears the tables and adds the desired values back on a schedule is one idea for this.) - -- [#478](https://github.com/withstudiocms/studiocms/pull/478) [`df24828`](https://github.com/withstudiocms/studiocms/commit/df2482847269c1b0d1ab7c6443deff243601fc08) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor rendering system to rely on plugin PageTypes instead of the old built-in system, this will allow new page types to easily bring their own renderer that can get called from the main renderer component. - - #### Breaking Changes - - - Removed MDX, and MarkDoc from built-in renderer. These will be replaced by plugins. - - Rendering system is now directly tied into the plugin PageTypes defined within plugins. Instead of passing just the content to the renderer, you now must pass the entire PageData from the SDK. - - New Rendering Component is now able to auto adapt to the pageType's provided renderer. (This means you can use the provided `` component to render any pageType that has been configured for StudioCMS through plugins. or use the data directly and render it yourself.) - - **OLD Method** (`[...slug].astro`) - - ```astro title="[...slug].astro" - --- - import { StudioCMSRenderer } from 'studiocms:renderer'; - import studioCMS_SDK from 'studiocms:sdk'; - import Layout from '../layouts/Layout.astro'; - - let { slug } = Astro.params; - - if (!slug) { - slug = 'index'; - } - - const page = await studioCMS_SDK.GET.databaseEntry.pages.bySlug(slug); - - if (!page) { - return new Response(null, { status: 404 }); - } - - const { title, description, heroImage, defaultContent } = page; - - const content = defaultContent.content || ''; - --- - - -
- -
-
- ``` - - **New Method** (`[...slug].astro`) - - ```astro title="[...slug].astro" - --- - import { StudioCMSRenderer } from 'studiocms:renderer'; - import studioCMS_SDK from 'studiocms:sdk'; - import Layout from '../layouts/Layout.astro'; - - let { slug } = Astro.params; - - if (!slug) { - slug = 'index'; - } - - const page = await studioCMS_SDK.GET.databaseEntry.pages.bySlug(slug); - - if (!page) { - return new Response(null, { status: 404 }); - } - - const { title, description, heroImage } = page; - --- - - -
- -
-
- ``` - -- [#481](https://github.com/withstudiocms/studiocms/pull/481) [`dae7795`](https://github.com/withstudiocms/studiocms/commit/dae77957cac866e47d09997ac6c990e3326459ea) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #481) - -- [#473](https://github.com/withstudiocms/studiocms/pull/473) [`ddc7eb8`](https://github.com/withstudiocms/studiocms/commit/ddc7eb8a9a351d851bb5820dcb2297dc4de793d9) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fix ambient types, and remove now unused stub files and type injection - - Consolidate all virtual types into a single file, - - - Previous exports such as `studiocms/v/core.d.ts` are now all under `studiocms/v/types` - -- [#479](https://github.com/withstudiocms/studiocms/pull/479) [`4880ce8`](https://github.com/withstudiocms/studiocms/commit/4880ce877a0c4bea3dcbe1c1565a78ab56603afc) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Remove unused dependencies and references - -- [#471](https://github.com/withstudiocms/studiocms/pull/471) [`9512aac`](https://github.com/withstudiocms/studiocms/commit/9512aac4a928423caf91cbaa1c89a29e9d40a731) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update Arctic to v3.5.0 and implement new required code verifier for auth0 and discord - -- [#486](https://github.com/withstudiocms/studiocms/pull/486) [`ddee17d`](https://github.com/withstudiocms/studiocms/commit/ddee17de1be97d05345caa4008de95c36e30333d) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #486) - -- [#473](https://github.com/withstudiocms/studiocms/pull/473) [`ddc7eb8`](https://github.com/withstudiocms/studiocms/commit/ddc7eb8a9a351d851bb5820dcb2297dc4de793d9) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update READMEs - -## 0.1.0-beta.12 - -- [#465](https://github.com/withstudiocms/studiocms/pull/465) [`66ca9c7`](https://github.com/withstudiocms/studiocms/commit/66ca9c7a5209edf2eb8e4a6336cb0db24936179e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Revert the SDK back to `@astrojs/db` instead of `drizzle-orm` as `drizzle-orm` was not causing our issues - -- [#456](https://github.com/withstudiocms/studiocms/pull/456) [`d66d081`](https://github.com/withstudiocms/studiocms/commit/d66d081748399e30d3940b6d1447f576d2e14c1c) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Expand SDK virtual cache system to allow more functionality either with the cache or passthrough to the normal SDK - -- [#455](https://github.com/withstudiocms/studiocms/pull/455) [`a23a95e`](https://github.com/withstudiocms/studiocms/commit/a23a95e5bf8209d456fc02468622840aa2167d40) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement runtime logger on all API routes - -- [#454](https://github.com/withstudiocms/studiocms/pull/454) [`1021093`](https://github.com/withstudiocms/studiocms/commit/1021093c253085dbe9dadf6a37913dc57654409e) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor pageType api endpoint management to prevent errors when using virtual modules within a APIRoute - -- [#458](https://github.com/withstudiocms/studiocms/pull/458) [`d445247`](https://github.com/withstudiocms/studiocms/commit/d4452478a83e59218f228c2d30a58447295841c4) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Hide and protect the deleted "Ghost" user from the dashboard - -- [#461](https://github.com/withstudiocms/studiocms/pull/461) [`49171af`](https://github.com/withstudiocms/studiocms/commit/49171af77f341b458cbb5155f656d9e7e1061a05) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement forgot password functionality if mailer is enabled - -- [#466](https://github.com/withstudiocms/studiocms/pull/466) [`feb37bf`](https://github.com/withstudiocms/studiocms/commit/feb37bf059aea1280eb466b4a1ff3807ce4518f8) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Move routes to their ts variant to resolve weird bundling issue with astro - -- [#464](https://github.com/withstudiocms/studiocms/pull/464) [`c77c4c7`](https://github.com/withstudiocms/studiocms/commit/c77c4c712982c3debdf0c34a2a635fb22c2d85d7) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Internal package organization, no user facing changes - -- [#459](https://github.com/withstudiocms/studiocms/pull/459) [`c914ec4`](https://github.com/withstudiocms/studiocms/commit/c914ec4e10f7b33503f958d5c06fba8f1bd9fd1d) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Extend mailer functionality into the auth system for optional Email verification - -- [#460](https://github.com/withstudiocms/studiocms/pull/460) [`0b4c1fe`](https://github.com/withstudiocms/studiocms/commit/0b4c1fef2f69c2b593a3c82d7eb4036aabb4efd9) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement basic email notifier system for User and Admin notifications - -- [#457](https://github.com/withstudiocms/studiocms/pull/457) [`1421e4c`](https://github.com/withstudiocms/studiocms/commit/1421e4c79907ddf1cb2d7360f2f87e81aabb719f) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement new SMTP `nodemailer` configuration for sending emails from StudioCMS - - #### SMTP Mailer Configuration: - - - Added SMTP mailer configuration options in the ConfigForm.astro file, including enabling/disabling the mailer and configuring SMTP settings. - - Introduced new routes and entry points for mailer configuration and test email functionalities in index.ts. - - #### Database Schema Updates: - - - Added a new table StudioCMSMailerConfig to store SMTP mailer settings. - - Updated existing tables to remove default values from JSON columns. (Potentially breaking) - -- [#462](https://github.com/withstudiocms/studiocms/pull/462) [`bf1b118`](https://github.com/withstudiocms/studiocms/commit/bf1b118852da3cd40293b71e96780f25d915c710) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update the email templates, modifying the user invite API route, and improving the handling of email sending errors. - -## 0.1.0-beta.11 - -- [#451](https://github.com/withstudiocms/studiocms/pull/451) [`bceda0a`](https://github.com/withstudiocms/studiocms/commit/bceda0a52fc51ea98914864e75201a147cb0ae46) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fix integration injection, and when quicktools are usable - -## 0.1.0-beta.10 - -- [#445](https://github.com/withstudiocms/studiocms/pull/445) [`a3b0b6d`](https://github.com/withstudiocms/studiocms/commit/a3b0b6dab8dc59a1c2dad2251e3d95d22da62a37) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor `.d.ts` files to prevent weird type errors from popping up - -- [#442](https://github.com/withstudiocms/studiocms/pull/442) [`8d9025d`](https://github.com/withstudiocms/studiocms/commit/8d9025dde99dd64fdae31a015357eff31027d481) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Refactor integration index to prevent parts of the StudioCMS integration from being enabled during the first-time-setup stage. - -- [#446](https://github.com/withstudiocms/studiocms/pull/446) [`610b759`](https://github.com/withstudiocms/studiocms/commit/610b759959b3fff33c541669b4c96a7e08d7ecaa) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Implement nanostore i18n client-side system to be used once i18n is ready - - This system is implemented in the dashboard but only the base locale ("en-us") is available at this time. - -- [#447](https://github.com/withstudiocms/studiocms/pull/447) [`a9a2d43`](https://github.com/withstudiocms/studiocms/commit/a9a2d43f731c9ed32e9cdd0b2467b5b80ce8b693) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Fix: Create page form was sending the wrong type of data. - -- [#443](https://github.com/withstudiocms/studiocms/pull/443) [`730b7d9`](https://github.com/withstudiocms/studiocms/commit/730b7d9a3a6818d20773b11e7e856e9a79884da2) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update declaration files to use dist directory instead of src - -## 0.1.0-beta.9 - -- [#433](https://github.com/withstudiocms/studiocms/pull/433) [`8931327`](https://github.com/withstudiocms/studiocms/commit/89313277bac0f5e17929eb8d4e064d42fe9c5ce5) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #433) - -- [#432](https://github.com/withstudiocms/studiocms/pull/432) [`4ac1dc2`](https://github.com/withstudiocms/studiocms/commit/4ac1dc295c56069cb126bd8c876fd98b31f9a8d8) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Relocate static assets to CDN R2 bucket, Users can now delete the `studiocms-resources/` folder within their project `public/` folder. - -- [#437](https://github.com/withstudiocms/studiocms/pull/437) [`e99f3d0`](https://github.com/withstudiocms/studiocms/commit/e99f3d0a1b089e24ca9a0c1f9d8f2ae1ba3d8b8e) Thanks [@studiocms-no-reply](https://github.com/studiocms-no-reply)! - Translation Updated (PR: #437) - -- [#441](https://github.com/withstudiocms/studiocms/pull/441) [`9dbe621`](https://github.com/withstudiocms/studiocms/commit/9dbe62125bd77ee674175dbb4fb64f5fa9ffc1ce) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - fix firsttime setup page redirect, and fix sdk - -## 0.1.0-beta.8 - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks \[@column.text({]\(https://github.com/column.text({)! - Auth system overhaul: - - #### **`studiocms`** - - - Updated all Dependencies - - #### **`@studiocms/auth`** - - - Update `astro:env` schema: - - `CMS_ENCRYPTION_KEY`: NEW - Required variable used for auth encryption, can be generated using `openssl rand --base64 16`. - - `CMS_GITHUB_REDIRECT_URI`: NEW - Optional variable for GitHub Redirect URI if using multiple redirect URIs with Github oAuth. - - Removed `Luicia` based auth system and `Lucia-astrodb-adapter` - - Removed old `authHelper` - - Add new OAuthButton components - - `` - - `` - - `oAuthButtonProviders.ts` - - Add new `` component and CSS - - Add new authentication library: - - Auth library is built using the lucia-next resources and will now be maintained under `@studiocms/auth` as its own full module - - Created Virtual module exports available during runtime - - Add new login/signup backgrounds - - Remove Middleware - - Add `studiocms-logo.glb` for usage with New ThreeJS login/signup page - - Update all Auth Routes - - Update schema - - Add new Scripts for ThreeJS - - Update Stubs files and Utils - - Refactor Integration to use new system. - - #### **`@studiocms/core`** - - - Disable interactivity for `` component. (Will always show a empty profile icon until we setup the new system for the front-end) - - - Update table schema: - - - `StudioCMSUsers`: Removed oAuth ID's from main user table - - ```diff - export const StudioCMSUsers = defineTable({ - columns: { - id: column.text({ primaryKey: true }), - url: column.text({ optional: true }), - name: column.text(), - email: column.text({ unique: true, optional: true }), - avatar: column.text({ optional: true }), - - githubId: column.number({ unique: true, optional: true }), - - githubURL: column.text({ optional: true }), - - discordId: column.text({ unique: true, optional: true }), - - googleId: column.text({ unique: true, optional: true }), - - auth0Id: column.text({ unique: true, optional: true }), - username: column.text(), - password: column.text({ optional: true }), - updatedAt: column.date({ default: NOW, optional: true }), - createdAt: column.date({ default: NOW, optional: true }), - }, - }); - ``` - - - `StudioCMSOAuthAccounts`: New table to handle all oAuth accounts and linking to Users - - ```ts - export const StudioCMSOAuthAccounts = defineTable({ - columns: { - provider: column.text(), // github, google, discord, auth0 - providerUserId: column.text({ primaryKey: true }), - userId: column.text({ references: () => StudioCMSUsers.columns.id }), - }, - }); - ``` - - - `StudioCMSPermissions`: Updated to use direct reference to users table - - ```ts - export const StudioCMSPermissions = defineTable({ - columns: { - references: () => StudioCMSUsers.columns.id }), - rank: column.text(), - }, - }); - ``` - - - `StudioCMSSiteConfig`: Added new options for login page - - ```ts - export const StudioCMSSiteConfig = defineTable({ - columns: { - id: column.number({ primaryKey: true }), - title: column.text(), - description: column.text(), - defaultOgImage: column.text({ optional: true }), - siteIcon: column.text({ optional: true }), - loginPageBackground: column.text({ default: "studiocms-curves" }), - loginPageCustomImage: column.text({ optional: true }), - }, - }); - ``` - - - Updated Routemap: - - - All Auth api routes are now located at `yourhost.tld/studiocms_api/auth/*` - - - Updated Strings: - - - Add new Encryption messages for the new `CMS_ENCRYPTION_KEY` variable - - - Removed now unused auth types. - - #### **`@studiocms/dashboard`** - - - Refactor to utilize new `@studiocms/auth` lib for user verification - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Update First time setup routes and API endpoints - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Translation Updated (PR: #391) - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Expand PageData table schema and add Catagory and Tags schemas, and extend WP-importer - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Added Author and Contributor tracking - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Docs, Docs, and more Docs - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement new Dashboard design and update API endpoints - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Dynamic Sitemap integration - - ##### Dynamic Sitemap Generation: - - - `packages/studiocms/src/index.ts`: Replaced the static sitemap integration with the new `dynamicSitemap` function to support multiple sitemaps from plugins. - - `packages/studiocms/src/lib/dynamic-sitemap/index.ts`: Added the `dynamicSitemap` function to generate sitemaps dynamically based on the provided plugin configurations. - - `packages/studiocms/src/lib/dynamic-sitemap/sitemap-index.xml.ts`: Created a new route to serve the sitemap index file, which lists all the individual sitemaps. - - ##### Plugin Schema Updates: - - - `packages/studiocms/src/schemas/plugins/index.ts`: Updated the plugin schema to include an optional `sitemaps` field, allowing plugins to specify their own sitemap configurations. - - ##### Plugin-Specific Sitemaps: - - - `packages/studiocms_blog/src/index.ts`: Updated the StudioCMS Blog plugin to include its own sitemaps for posts and markdown pages. - - `packages/studiocms_blog/src/routes/sitemap-md.xml.ts`: Added a new route to generate the sitemap for markdown pages. - - `packages/studiocms_blog/src/routes/sitemap-posts.xml.ts`: Added a new route to generate the sitemap for blog posts. - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Remove Astro ViewTransitions/ClientRouter - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - User invite and creation systems - - ##### User Management Enhancements: - - - Added modals for creating new users and user invites in `InnerSidebarElement.astro` to streamline the user creation process. - - Implemented new API routes `create-user` and `create-user-invite` to handle user creation and invite processes. - - Updated `routeMap.ts` to include new endpoints for user creation and invites. - - ##### UI Improvements: - - - Modified icons for 'Create Page' and 'Create Folder' options in `InnerSidebarElement.astro` to use standard document and folder icons. - - Enhanced the user management dropdown by reordering properties for better readability. - - Added custom styles for modal bodies to improve the user interface. - - ##### Utility and SDK Updates: - - - Added new utility functions for generating random passwords and IDs in `generators.ts`, and updated references in `core.ts`. - - Updated the SDK core to support rank assignment during user creation. - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Enhance StudioCMS Plugin system - - - Implement Dashboard pages - - Add Optional API Routes and Fields for page types - - Update Astro Web Vital plugin to add new dashboard page - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement Build step with esbuild and Update for Astro v5 - -- [#430](https://github.com/withstudiocms/studiocms/pull/430) [`36474b5`](https://github.com/withstudiocms/studiocms/commit/36474b592dd014635019d346f28688f8f5a60585) Thanks [@Adammatthiesen](https://github.com/Adammatthiesen)! - Update dependencies - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Add @studiocms/markdown-remark as a renderer option, and implement component proxy system to actually be used by this renderer - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement User quick action toolbar for frontend when user's are logged in - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Translation Updated (PR: #376) - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement Diff tracking system - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - New Renderer component - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Introduce Dashboard i18n logic - - - `studiocms` & `@studiocms/core`: - - - Introduce new virtual module `studiocms:i18n`: - This module includes utilities for our new i18n system. - - Add new LanguageSelector component - - Add `en-us` translation file. (`packages/studiocms_core/i18n/translations/`) - - - `@studiocms/auth`: - - Update login/signup routes to utilize new i18n translations - - Transition routes to Hybrid type setup, All API routes will remain server rendered, while pages are now prerendered (Server islands when needed). - -- [#312](https://github.com/withstudiocms/studiocms/pull/312) [`9c59d72`](https://github.com/withstudiocms/studiocms/commit/9c59d7230c86d8122c90c8b42c382a32a6d9820e) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - ♻️ Chore: We are now Turso Sponsored! - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Update Frontend logic and fix some small issues with rendering. - - - New Renderer Partial for rendering on-the-fly - - Updated changelog endpoint to use new partial to fix rendering - - Fixed TS Error in SDK - - Fixed changelog rendering - - Cleaned up Frontend package layout - - Simplified Frontend route generation to use 1 file - - Updated all exports. - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Introduce BASIC version of our plugin system. - - Currently Supports: - - - Custom Settings Page - - Assign your fields - - Bring your own API Endpoint function - - Ability to add Frontend page links - - Set the minimum StudioCMS Version - - Bring your own Astro Integrations - - Basic Page type identifier system - - This system will eventually be expanded to allow custom Content types and access to passing custom content handling methods for custom implementations. - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement Component Proxy functionality - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement new StudioCMS SDK in @studiocms/core and integrate it into the new dashboard and frontend package - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Remove Unpic and simplify imageHandler - -- [#301](https://github.com/withstudiocms/studiocms/pull/301) [`ebc297f`](https://github.com/withstudiocms/studiocms/commit/ebc297f2818deda6efca880a857f7e0929ad2378) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Update `.d.ts` file generation (non breaking) - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Merge StudioCMS packages into main package - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement new StudioCMS Auth lib - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Update URLs - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Small css tweak - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - New CLI, Updated integration logic and updated config processing. - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Add warning if no Adapter is present - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Fix CSS issue that caused sidebar to flow off the screen - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Adjusted strings to account for Astro Studio sunsetting - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - Implement dashboard grid components system - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - StudioCMS is now headless, all routes have been moved to `@studiocms/blog` and that is now the recommended default plugin to install for users who want a basic headful setup - -- [#333](https://github.com/withstudiocms/studiocms/pull/333) [`62ff52f`](https://github.com/withstudiocms/studiocms/commit/62ff52f9f089c9605da9227b0e75c755768ed96c) Thanks [@create-issue-branch](https://github.com/apps/create-issue-branch)! - New REST API endpoints and Dashboard UI features - - New Routes: - - - `/studiocms_api/rest/v1/folders` - - `/studiocms_api/rest/v1/folders/[id]` - - `/studiocms_api/rest/v1/pages` - - `/studiocms_api/rest/v1/pages/[id]` - - `/studiocms_api/rest/v1/pages/[id]/history` - - `/studiocms_api/rest/v1/pages/[id]/history/[id]` - - `/studiocms_api/rest/v1/settings` - - `/studiocms_api/rest/v1/users` - - `/studiocms_api/rest/v1/users/[id]` - - All routes listed above are behind authentication. - - There is the following PUBLIC endpoints that ONLY support GET requests to published pages/folders - - - `/studiocms_api/rest/v1/public/pages` - - `/studiocms_api/rest/v1/public/pages/[id]` - - `/studiocms_api/rest/v1/public/folders` - - `/studiocms_api/rest/v1/public/folders/[id]` - -## 0.1.0-beta.7 - -- Update URL from `astro-studiocms.xyz` to `studiocms.xyz` - -## 0.1.0-beta.6 - -- Update dependencies - -- Update readme, and package.json naming as well as references to Astro Studio to AstroDB. - -- Update readmes to reflect new package name - -- \[Update readme]: Update Astro Studio references to AstroDB as Studio is closing down. - -- \[Refactor]: Update main config schema for renderers. - - - Removed `contentRenderer` and `markedConfig` from the main options - - Added config for MarkDoc - - Created new `rendererConfig` section: - - ```ts - // astro.config.mjs - // https://astro.build/config - export default defineConfig({ - // ...Rest of Astro Config - integrations: [ - studiocms({ - // ...Rest of StudioCMS Config - // (This is the same if you use the 'studiocms.config.mjs' file) - rendererConfig: { - renderer: "marked", // Can also be 'astro', or 'markdoc' - markedConfig: { - /* MarkedJS Config */ - }, - markdocConfig: { - /* MarkDoc Config */ - }, - }, - }), - ], - }); - ``` - -- \[Migrate/Deprecation]: customRendererPlugin moved to StudioCMSRendererConfig - - - Deprecation of StudioCMSPluginOptions defined CustomRenderers - - Add new option to define renderers from StudioCMSOptions config: - - ```ts - // astro.config.mjs - function simpleHTMLRenderer(content: string) { - return { - name: "simple-html-renderer", - renderer: async (content: string) => { - return `

${content}

`; - }, - }; - } - - // https://astro.build/config - export default defineConfig({ - // ...Rest of Astro Config - integrations: [ - studiocms({ - // ...Rest of StudioCMS Config - // (This is the same if you use the 'studiocms.config.mjs' file) - rendererConfig: { - renderer: simpleHTMLRenderer, - }, - }), - ], - }); - ``` - -## 0.1.0-beta.5 - -- \[Refactor/Rename]: Split main package into smaller packages and rename main package. - - This change will allow a better divide between the StudioCMS ecosystem packages. The main Astro Integration is now named `studiocms`. - - Renamed Packages: - - - `studiocms`: The main package that users will download and use. - - `@studiocms/blog`: The StudioCMSBlog Plugin - - New Packages and their purposes: - - - `@studiocms/core`: Core components and functions - - `@studiocms/assets`: Assets used for the StudioCMS Dashboard and other integrations - - `@studiocms/renderers`: StudioCMS renderer system - - `@studiocms/imagehandler`: StudioCMS image service and components - - `@studiocms/auth`: StudioCMS auth routes and middleware - - `@studiocms/frontend`: Userfacing pages and routes - - `@studiocms/dashboard`: The main dashboard components, routes, and API endpoints - - `@studiocms/robotstxt`: Generation of robots.txt file - - `@studiocms/betaresources`: Resources for the beta. - -- \[Breaking]: Update AstroDB Table Schemas to use prefixed table names (i.e. `Permissions` -> `StudioCMSPermissions` ) - - This change will require migration to a new database or a full wipe of the current database. - - It is recommended to link to a new database and push the new schema changes and migrate your data from the old one. - -## 0.1.0-beta.4 - -- Implement extension system for Plugins to include new dashboard pages right in the sidebar - -- Refactor Authhelper (no end user changes needed) - -- \[Fix]: Ensure `@astrojs/web-vitals` integration is an optional addon and not required. - -- \# Breaking Changes - - - \[Breaking]: Astro 4.14.5 is now the lowest supported version of StudioCMS - - \[Breaking]: AstroDB 0.13.2 is now the lowest supported version of StudioCMS - - # Non-Breaking Changes - - - \[Update]: Utilize new InjectTypes from Astro instead of addDts from AIK (No user changes needed) - - \[Update]: `@matthiesenxyz/integration-utils` updated to newest version and fix usage (No user changes needed) - - \[Refactor]: Move web-vitals child components into their own folder (No user changes needed) - - \[Refactor]: Update [`isDashboardRoute.ts`](https://github.com/astrolicious/studiocms/blob/main/packages/studioCMS/src/integrations/studioCMSDashboard/routes/dashboard/components/isDashboardRoute.ts) to use `.include()` instead of direct comparison (No user changes needed) - - \[Refactor]: Move to namespacebuiltins vite plugin(Astro Integration) included from `@matthiesenxyz/integration-utils` instead of the internal copy (No user changes needed) - - \[Fix]: Remove now not needed exclude rules for `@matthiesenxyz/integration-utils` (No user changes needed) - -## 0.1.0-beta.3 - -- New Mailing system for Beta Feedback form - -- Fix: Allow studiocms-auth.config.json to be created during first time database setup - -- \[Bug]: Fix case sensitivity issue in authHelper function - -## 0.1.0-beta.2 - -- Validate secrets (or not) for `astro:env` - -- Add check for unsafe usernames or passwords when creating local username/password accounts - -- \- StudioCMS-Dashboard: - - Update UnoCSS to `0.61.5` and DaisyUI Preset to `0.1.1` - -- Lint project code - -- Sidebar signout for guest users - -## 0.1.0-beta.1 - -- Initial beta release From 939b2a9133c15c19ac3c69adf3f41b6a985d5ae1 Mon Sep 17 00:00:00 2001 From: Jenxi Date: Thu, 5 Jun 2025 20:42:10 +0800 Subject: [PATCH 06/25] Update index.mdx Fixed link syntax --- src/content/docs/zh-cn/plugins/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/zh-cn/plugins/index.mdx b/src/content/docs/zh-cn/plugins/index.mdx index 5a20b275..e286877e 100644 --- a/src/content/docs/zh-cn/plugins/index.mdx +++ b/src/content/docs/zh-cn/plugins/index.mdx @@ -125,5 +125,5 @@ export const myPlugin = (options: Options) => definePlugin({ 深入了解插件开发实践,请参阅[高效插件开发指南][extended-plugins] -{/* 文档链接 */} +{/* Links */} [extended-plugins]: /zh-cn/plugins/extended/ \ No newline at end of file From b29993aa987f66a7e690e3e628caa8aa6d5287e0 Mon Sep 17 00:00:00 2001 From: Jenxi Date: Thu, 5 Jun 2025 20:45:15 +0800 Subject: [PATCH 07/25] Update studiocms-blog.mdx --- .../studiocms-plugins/studiocms-blog.mdx | 191 +----------------- 1 file changed, 1 insertion(+), 190 deletions(-) diff --git a/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-blog.mdx b/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-blog.mdx index 1afb863f..367aee85 100644 --- a/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-blog.mdx +++ b/src/content/docs/zh-cn/package-catalog/studiocms-plugins/studiocms-blog.mdx @@ -44,193 +44,4 @@ import { Steps, Tabs, TabItem } from '@astrojs/starlight/components'; - `/[...slug]` - 通用内容路由(用于常规页面) - `/blog` - 博客主页(文章列表) - `/blog/[slug]` - 单篇博客文章详情页 -- `/rss.xml` - 自动生成的博客 RSS 订阅源 - -### 高级配置 -```ts twoslash {4-6} title="自定义博客路径" -import blog from '@studiocms/blog'; - -export default defineStudioCMSConfig({ - plugins: [ - blog({ - basePath: '/articles', // 修改博客基础路径 - postRoute: '/entry' // 修改文章详情路径 - }), - ], -}); -``` - -### 博文数据结构 -```graphql -type BlogPost { - id: ID! - title: String! - excerpt: String - content: RichText! - featuredImage: Asset - tags: [Tag!]! - publishDate: DateTime! - author: User! -} -``` - -## 使用说明 - -### 创建博文流程 -1. 登录 StudioCMS 仪表盘 -2. 导航到**博客 → 文章** -3. 点击**新建文章** -4. 填写内容并设置特色图片 -5. 选择发布状态:草稿/立即发布/定时发布 - -### 模板定制 -默认模板文件位置: -```bash -src/ - components/ - studiocms/ - blog/ - BlogList.astro # 博客列表页组件 - BlogPost.astro # 博文详情页组件 -``` -可复制这些文件到您的项目中进行覆盖: -```astro title="src/layouts/BlogLayout.astro" ---- -// 自定义博客布局 ---- - - - 我的技术博客 - - -
网站导航栏
- -
© 2024 我的博客
- - -``` - -> **性能提示**:对内容密集型博客,建议在 `.env` 文件中设置: -> ```ini -> STUDIOCMS_BLOG_PAGE_SIZE=10 # 每页显示10篇文章 -> STUDIOCMS_PREVIEW_IMAGE_QUALITY=80 # 预览图质量压缩 -> ``` - -```markdown ---- -i18nReady: true -title: "@studiocms/blog" -type: integration -catalogEntry: studiocms-blog -description: "StudioCMS 博客集成插件" -sidebar: - badge: - text: '插件' - variant: 'tip' ---- - -import { PackageManagers } from 'starlight-package-managers' -import { Steps, Tabs, TabItem } from '@astrojs/starlight/components'; - -# 简介 - -该插件为 Astro 项目提供 StudioCMS 博客功能及前端界面,支持从 StudioCMS 仪表盘创建、编辑和管理博客文章。 - -## 安装步骤 - -1. 使用以下命令安装软件包: - - - -2. 在 StudioCMS 配置中添加该插件: - - ```ts twoslash title="studiocms.config.mjs" {2, 6} - import { defineStudioCMSConfig } from 'studiocms/config'; - import blog from '@studiocms/blog'; // 导入博客插件 - - export default defineStudioCMSConfig({ - plugins: [ - blog(), // 启用博客功能 - ], - }); - ``` -## 核心功能 - -### 此集成提供的能力 - -该插件将向 StudioCMS 控制的前端应用添加以下路由: - -- `/[...slug]` - 通用内容路由(用于常规页面) -- `/blog` - 博客主页(文章列表) -- `/blog/[slug]` - 单篇博客文章详情页 -- `/rss.xml` - 自动生成的博客 RSS 订阅源 - -### 高级配置 -```ts twoslash {4-6} title="自定义博客路径" -import blog from '@studiocms/blog'; - -export default defineStudioCMSConfig({ - plugins: [ - blog({ - basePath: '/articles', // 修改博客基础路径 - postRoute: '/entry' // 修改文章详情路径 - }), - ], -}); -``` - -### 博文数据结构 -```graphql -type BlogPost { - id: ID! - title: String! - excerpt: String - content: RichText! - featuredImage: Asset - tags: [Tag!]! - publishDate: DateTime! - author: User! -} -``` - -## 使用说明 - -### 创建博文流程 -1. 登录 StudioCMS 仪表盘 -2. 导航到**博客 → 文章** -3. 点击**新建文章** -4. 填写内容并设置特色图片 -5. 选择发布状态:草稿/立即发布/定时发布 - -### 模板定制 -默认模板文件位置: -```bash -src/ - components/ - studiocms/ - blog/ - BlogList.astro # 博客列表页组件 - BlogPost.astro # 博文详情页组件 -``` -可复制这些文件到您的项目中进行覆盖: -```astro title="src/layouts/BlogLayout.astro" ---- -// 自定义博客布局 ---- - - - 我的技术博客 - - -
网站导航栏
- -
© 2024 我的博客
- - -``` - -> **性能提示**:对内容密集型博客,建议在 `.env` 文件中设置: -> ```ini -> STUDIOCMS_BLOG_PAGE_SIZE=10 # 每页显示10篇文章 -> STUDIOCMS_PREVIEW_IMAGE_QUALITY=80 # 预览图质量压缩 -> ``` \ No newline at end of file +- `/rss.xml` - 自动生成的博客 RSS 订阅源 \ No newline at end of file From d77ebdd7f03dd6ccbc8e5df167b194bb249b4d54 Mon Sep 17 00:00:00 2001 From: Jenxi Date: Thu, 5 Jun 2025 20:45:45 +0800 Subject: [PATCH 08/25] Update index.mdx Translated file --- .../docs/zh-cn/package-catalog/index.mdx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/content/docs/zh-cn/package-catalog/index.mdx b/src/content/docs/zh-cn/package-catalog/index.mdx index 8e0654b4..93d0a238 100644 --- a/src/content/docs/zh-cn/package-catalog/index.mdx +++ b/src/content/docs/zh-cn/package-catalog/index.mdx @@ -1,28 +1,28 @@ --- i18nReady: true -title: Packages -description: The Package Catalog is a collection of packages by StudioCMS or its community. +title: 包目录 +description: "包目录是由 StudioCMS 或其社区提供的软件包集合。" --- import PackageCatalog from '~/components/PackageCatalog.astro' import { Badge } from '@astrojs/starlight/components'; -The Package Catalog is a collection of packages by StudioCMS or its community members, that are not included within StudioCMS by default. All packages listed here are verified and tested by the StudioCMS team or its contributors. +包目录是 StudioCMS 或其社区成员提供的软件包集合,这些软件包默认不包含在 StudioCMS 中。此处列出的所有软件包都经过 StudioCMS 团队或其贡献者的验证和测试。 -Any package labeled as a is a package that extends the functionality of StudioCMS or its dashboard. +标记为的软件包是用于扩展 StudioCMS 或其仪表板功能的包。 -Plugins can also be labeled as which means the plugin is still early in development and could face major changes to its internals at any time. This plugin may or may not also be ready for usage. +插件可能同时标记为,这表示该插件仍处于早期开发阶段,其内部实现可能随时发生重大变更。此类插件也可能尚未准备好用于生产环境。 -Any package labeled as is able to be installed and used in projects that do not rely on studiocms. They can work on their own. +标记为的软件包可独立安装使用,无需依赖 StudioCMS 环境。 -## Package Catalogs +## 包目录分类 -### StudioCMS Packages +### StudioCMS 官方包目录 --- -### Community Packages +### 社区包目录 --- \ No newline at end of file From dcf9b8eb9aa5fb5d2ee7f96d22cb3fcd707bdb2b Mon Sep 17 00:00:00 2001 From: Jenxi Date: Thu, 5 Jun 2025 20:45:55 +0800 Subject: [PATCH 09/25] Update sdk.mdx --- src/content/docs/zh-cn/how-it-works/sdk.mdx | 213 ++++++++++---------- 1 file changed, 111 insertions(+), 102 deletions(-) diff --git a/src/content/docs/zh-cn/how-it-works/sdk.mdx b/src/content/docs/zh-cn/how-it-works/sdk.mdx index 97d93016..396d163a 100644 --- a/src/content/docs/zh-cn/how-it-works/sdk.mdx +++ b/src/content/docs/zh-cn/how-it-works/sdk.mdx @@ -1,33 +1,36 @@ --- i18nReady: true -title: "SDK 开发指南" -description: "StudioCMS SDK 详细使用说明" +title: "SDK" +description: "了解 StudioCMS SDK 及其使用方法。" sidebar: order: 3 --- import ReadMore from '~/components/ReadMore.astro'; -StudioCMS SDK 是一个强大的编程接口,允许开发者以编程方式与 StudioCMS 交互。它提供了一系列函数和工具,用于通过 Astro DB 管理和呈现内容,同时也是 StudioCMS 仪表板的核心技术支撑。 +StudioCMS SDK 是一个强大的工具,允许您以编程方式与 StudioCMS 交互。它提供了一套函数和实用工具,使您能够使用 Astro DB 管理和提供内容。它同时也是 StudioCMS 仪表板的核心基础。 -## 基本使用 +## 使用方法 -SDK 作为虚拟模块在 Astro 项目中可用,可通过以下方式导入: +StudioCMS SDK 在您的 Astro 项目中作为虚拟模块提供。您可以使用以下语法导入它: ```ts twoslash /// // ---cut--- -import SDK from 'studiocms:sdk'; // 标准 SDK -import SDKCached from 'studiocms:sdk/cache'; // 带缓存层的 SDK +import SDK from 'studiocms:sdk'; +// 或者 +import SDKCached from 'studiocms:sdk/cache'; ``` -`studioCMSSDK` 对象提供完整的 CRUD 操作能力,而 `studioCMSSDKCached` 则在其基础上添加了缓存层优化性能。 +`studioCMSSDK` 对象提供了一套允许您与 StudioCMS 交互的函数和实用工具。您可以使用这些函数在 Astro 项目中创建、读取、更新和删除内容。 -## 标准 SDK +`studioCMSSDKCached` 对象提供了一套函数和实用工具,允许您在 StudioCMS SDK 之上使用缓存层进行交互。您可以使用这些函数在 Astro 项目中缓存内容。 + +## StudioCMS SDK (标准版) ### `SDK.AUTH` -认证管理模块,提供用户认证、会话管理等功能: +`SDK.AUTH` 对象提供了一套管理 Astro 项目身份验证的函数和实用工具。您可以使用这些函数来验证用户、管理会话等。 ```ts twoslash /// @@ -35,16 +38,16 @@ import SDKCached from 'studiocms:sdk/cache'; // 带缓存层的 SDK import SDK from 'studiocms:sdk'; const { - oAuth, // OAuth 认证处理 - permission, // 权限管理 - session, // 会话控制 - user, // 用户管理 + oAuth, + permission, + session, + user, } = SDK.AUTH; ``` ### `SDK.INIT` -系统初始化模块,用于 SDK 的初始配置: +`SDK.INIT` 对象提供了一套用于在 Astro 项目中初始化 StudioCMS SDK 的函数和实用工具。您可以使用这些函数设置 SDK、进行配置等。 ```ts twoslash /// @@ -52,14 +55,14 @@ const { import SDK from 'studiocms:sdk'; const { - siteConfig, // 站点配置 - ghostUser, // 系统幽灵用户 + siteConfig, + ghostUser, } = SDK.INIT; ``` ### `SDK.GET` -数据读取模块,提供多种数据查询功能: +`SDK.GET` 对象提供了一套从 Astro DB 检索内容的函数和实用工具。您可以使用这些函数按 ID 获取内容、按类型获取内容等。 ```ts twoslash /// @@ -67,17 +70,17 @@ const { import SDK from 'studiocms:sdk'; const { - database, // 数据库操作 - databaseEntry, // 单条记录查询 - databaseTable, // 表级查询 - permissionsLists, // 权限列表 - packagePages, // 插件页面 + database, + databaseEntry, + databaseTable, + permissionsLists, + packagePages, } = SDK.GET; ``` ### `SDK.POST` -数据创建模块,用于添加新记录: +`SDK.POST` 对象提供了一套在 Astro DB 中创建内容的函数和实用工具。您可以使用这些函数按类型创建内容、按 ID 创建内容等。 ```ts twoslash /// @@ -85,14 +88,14 @@ const { import SDK from 'studiocms:sdk'; const { - databaseEntry, // 创建单条记录 - databaseEntries, // 批量创建记录 + databaseEntry, + databaseEntries, } = SDK.POST; ``` ### `SDK.UPDATE` -数据更新模块,支持内容修改操作: +`SDK.UPDATE` 对象提供了一套更新 Astro DB 中内容的函数和实用工具。您可以使用这些函数按 ID 更新内容、按类型更新内容等。 ```ts twoslash /// @@ -100,19 +103,19 @@ const { import SDK from 'studiocms:sdk'; const { - page, // 页面更新 - pageContent, // 内容更新 - tags, // 标签管理 - categories, // 分类管理 - permissions, // 权限更新 - siteConfig, // 配置更新 - folder, // 文件夹管理 + page, + pageContent, + tags, + categories, + permissions, + siteConfig, + folder, } = SDK.UPDATE; ``` ### `SDK.DELETE` -数据删除模块,提供精准的数据移除能力: +`SDK.DELETE` 对象提供了一套从 Astro DB 中删除内容的函数和实用工具。您可以使用这些函数按 ID 删除内容、按类型删除内容等。 ```ts twoslash /// @@ -120,35 +123,35 @@ const { import SDK from 'studiocms:sdk'; const { - page, // 页面删除 - pageContent, // 内容删除 - pageContentLang, // 多语言内容删除 - tags, // 标签删除 - categories, // 分类删除 - permissions, // 权限移除 - diffTracking, // 变更追踪删除 - folder, // 文件夹删除 - user, // 用户删除 + page, + pageContent, + pageContentLang, + tags, + categories, + permissions, + diffTracking, + folder, + user, } = SDK.DELETE; ``` ### `SDK.db` -直接操作 Astro DB 的核心接口: +`SDK.db` 对象提供了一套直接与 Astro DB 交互的函数和实用工具。您可以使用这些函数查询数据库、运行自定义查询等。 ```ts twoslash /// // ---cut--- import SDK from 'studiocms:sdk'; -const { db } = SDK; // 直接数据库访问 +const { db } = SDK; ``` -深入了解 `db` 用法请参阅 [Astro DB 指南](https://docs.astro.build/en/guides/astro-db/) +有关如何使用 `db` 的更多信息,请查看 [Astro DB 指南](https://docs.astro.build/en/guides/astro-db/) ### `SDK.REST_API` -REST API 底层处理模块: +`SDK.REST_API` 对象提供了一套 REST API 用来与 StudioCMS 和 Astro DB 交互的函数和实用工具。 ```ts twoslash /// @@ -157,17 +160,17 @@ import SDK from 'studiocms:sdk'; const { tokens: { - get: getToken, // 获取令牌 - new: newToken, // 创建新令牌 - delete: deleteToken, // 删除令牌 - verify: verifyToken, // 验证令牌 + get: getToken, + new: newToken, + delete: deleteToken, + verify: verifyToken, }, } = SDK.REST_API; ``` ### `SDK.diffTracking` -变更追踪系统,记录数据历史版本: +`SDK.diffTracking` 对象提供了一套跟踪 Astro DB 中变更的函数和实用工具。您可以使用这些函数跟踪内容变更、用户变更等。 ```ts twoslash /// @@ -175,44 +178,49 @@ const { import SDK from 'studiocms:sdk'; const { - insert, // 插入变更记录 - clear, // 清除变更记录 - get, // 获取变更记录 - revertToDiff // 回滚到指定版本 + insert, + clear, + get, + revertToDiff } = SDK.diffTracking; ``` -### 工具函数集合 +### 实用工具函数 -SDK 提供丰富的实用工具: +StudioCMS SDK 还提供了一套可与 SDK 交互的实用工具函数。这些函数包括: ```ts twoslash /// // ---cut--- import SDK from 'studiocms:sdk'; -// 文件夹操作 -const { addPageToFolderTree } = SDK; - -// 节点查询 -const { findNodeById, findNodeByPath } = SDK; - -// ID 处理 -const { parseIdNumberArray, generateRandomIDNumber } = SDK; - -// 安全功能 -const { generateToken, verifyRank } = SDK; - -// 数据收集 -const { collectCategories, collectUserData } = SDK; - -// 其他工具 -const { getFullPath, buildFolderTree } = SDK; +const { + addPageToFolderTree, + findNodeById, + findNodeByPath, + findNodesAlongPath, + getFullPath, + parseIdNumberArray, + parseIdStringArray, + generateRandomIDNumber, + generateToken, + testToken, + combineRanks, + verifyRank, + buildFolderTree, + getAvailableFolders, + clearUserReferences, + collectCategories, + collectTags, + collectPageData, + collectUserData, + generateRandomPassword, +} = SDK; ``` -## 缓存版 SDK +## StudioCMS SDK (缓存版) -带缓存层的 SDK 导入方式: +StudioCMS SDK 还提供了一个具有部分标准 SDK 功能并在其基础上增加缓存层的缓存版本。您可以使用以下语法导入缓存版 SDK: ```ts twoslash /// @@ -222,7 +230,7 @@ import SDKCached from 'studiocms:sdk/cache'; ### `SDKCached.GET` -带缓存的数据读取接口: +`SDKCached.GET` 对象提供了一套带缓存的从 Astro DB 检索内容的函数和实用工具。您可以使用这些函数按 ID 获取内容、按类型获取内容等。 ```ts twoslash /// @@ -230,20 +238,20 @@ import SDKCached from 'studiocms:sdk/cache'; import SDKCached from 'studiocms:sdk/cache'; const { - page, // 单页面缓存读取 - pages, // 多页面缓存读取 - siteConfig, // 配置缓存 - latestVersion, // 最新版本号 - folderTree, // 文件夹树结构 - pageFolderTree, // 页面文件夹结构 - folderList, // 文件夹列表 - folder, // 单文件夹 + page, + pages, + siteConfig, + latestVersion, + folderTree, + pageFolderTree, + folderList, + folder, } = SDKCached.GET; ``` ### `SDKCached.CLEAR` -缓存清除功能: +`SDKCached.CLEAR` 对象提供了一套用于清除缓存版 SDK 中缓存的函数和实用工具。您可以使用这些函数清除特定内容类型的缓存、清除特定内容 ID 的缓存等。 ```ts twoslash /// @@ -251,17 +259,17 @@ const { import SDKCached from 'studiocms:sdk/cache'; const { - page, // 清除页面缓存 - pages, // 清除多页面缓存 - latestVersion, // 清除版本缓存 - folderTree, // 清除文件夹树缓存 - folderList, // 清除文件夹列表缓存 + page, + pages, + latestVersion, + folderTree, + folderList, } = SDKCached.CLEAR; ``` ### `SDKCached.UPDATE` -带缓存更新的操作接口: +`SDKCached.UPDATE` 对象提供了一套带缓存的更新 Astro DB 中内容的函数和实用工具。您可以使用这些函数按 ID 更新内容、按类型更新内容等。 ```ts twoslash /// @@ -269,17 +277,18 @@ const { import SDKCached from 'studiocms:sdk/cache'; const { - page, // 更新页面缓存 - siteConfig, // 更新配置缓存 - latestVersion, // 更新版本缓存 - folderTree, // 更新文件夹树 - folderList, // 更新文件夹列表 - folder, // 更新单个文件夹 + page, + siteConfig, + latestVersion, + folderTree, + folderList, + folder, } = SDKCached.UPDATE; ``` ### `SDKCached.db` -透明传递的标准 `db` 对象: +这是指向标准 SDK `db` 对象的直接通路。 -详见上文 [`SDK.db`](#sdkdb) 说明 \ No newline at end of file +更多信息请参见 [`SDK.db`](#sdkdb) +``` \ No newline at end of file From 4e8c23e08c53070aec6f08a68b51173defda914c Mon Sep 17 00:00:00 2001 From: Jenxi Date: Fri, 6 Jun 2025 17:08:06 +0800 Subject: [PATCH 10/25] Updated translations --- .../docs/zh-cn/config-reference/index.mdx | 2 +- .../docs/zh-cn/config-reference/overrides.mdx | 26 +--- .../docs/zh-cn/config-reference/sdk.mdx | 63 +------- .../contributing/code-contributions.mdx | 2 +- .../guides/contributing/getting-started.mdx | 2 +- .../guides/contributing/translations.mdx | 7 +- .../zh-cn/guides/database/sqld-server.mdx | 55 +------ .../upgrade/version-guides/0-1-0-beta-16.mdx | 48 +----- .../upgrade/version-guides/0-1-0-beta-17.mdx | 96 ++---------- .../upgrade/version-guides/0-1-0-beta-18.mdx | 105 ++------------ src/content/docs/zh-cn/how-it-works/cli.mdx | 70 ++------- src/content/docs/zh-cn/how-it-works/index.mdx | 73 +--------- .../docs/zh-cn/how-it-works/restapi.mdx | 137 ++---------------- src/content/docs/zh-cn/index.mdx | 2 +- .../community-plugins/web-vitals.mdx | 2 +- .../studiocms-plugins/studiocms-blog.mdx | 2 +- .../studiocms-plugins/studiocms-devapps.mdx | 3 + .../studiocms-plugins/studiocms-markdoc.mdx | 5 +- .../studiocms-plugins/studiocms-mdx.mdx | 3 +- .../studiocms-plugins/studiocms-wysiwyg.mdx | 3 +- src/content/docs/zh-cn/plugins/extended.mdx | 79 +++------- src/content/docs/zh-cn/plugins/index.mdx | 6 +- .../docs/zh-cn/start-here/configuration.mdx | 2 +- .../start-here/environment-variables.mdx | 2 +- .../docs/zh-cn/start-here/getting-started.mdx | 10 +- src/content/docs/zh-cn/utils/rendering.mdx | 3 +- 26 files changed, 119 insertions(+), 689 deletions(-) diff --git a/src/content/docs/zh-cn/config-reference/index.mdx b/src/content/docs/zh-cn/config-reference/index.mdx index 0acc65d7..09c1f50d 100644 --- a/src/content/docs/zh-cn/config-reference/index.mdx +++ b/src/content/docs/zh-cn/config-reference/index.mdx @@ -178,7 +178,7 @@ export default defineStudioCMSConfig({ [查看 `sdk` 完整选项][sdk] -{/* 文档内部链接 */} +{/* Links */} [overrides]: /zh-cn/config-reference/overrides/ [image-service]: /zh-cn/config-reference/image-service/ [default-frontend-config]: /zh-cn/config-reference/default-frontend-config/ diff --git a/src/content/docs/zh-cn/config-reference/overrides.mdx b/src/content/docs/zh-cn/config-reference/overrides.mdx index 1ddda98e..bbc3e61c 100644 --- a/src/content/docs/zh-cn/config-reference/overrides.mdx +++ b/src/content/docs/zh-cn/config-reference/overrides.mdx @@ -77,28 +77,4 @@ const formattedDate = Astro.props.date.toLocaleDateString( --- -``` - -### 配置说明: - -1. **覆盖机制**: - - 当指定 `CustomImageOverride` 时,StudioCMS 将使用您的自定义组件替代默认图像组件 - - `FormattedDateOverride` 同理覆盖默认日期格式化组件 - -2. **组件要求**: - - 自定义组件必须实现与默认组件相同的 props 接口 - - 图像组件需支持 StudioCMS 的图像处理参数 - - 日期组件需接收 `date: Date` 属性 - -> **注意**:默认组件代码展示了基础实现逻辑,覆盖后仍需保持兼容性。您可以在自定义组件中扩展功能,但需确保核心输出格式保持不变以避免渲染异常。组件路径应为相对项目根目录的有效路径。 - -### 最佳实践: -```ts -// 建议为覆盖组件创建独立目录 -overrides: { - CustomImageOverride: 'src/components/studiocms/CustomImage.astro', - FormattedDateOverride: 'src/components/studiocms/CustomDate.astro', -} -``` - -所有覆盖配置应在 `studiocms.config.mjs` 文件中进行,修改后需重启开发服务器生效。 \ No newline at end of file +``` \ No newline at end of file diff --git a/src/content/docs/zh-cn/config-reference/sdk.mdx b/src/content/docs/zh-cn/config-reference/sdk.mdx index f76a66d6..c395501b 100644 --- a/src/content/docs/zh-cn/config-reference/sdk.mdx +++ b/src/content/docs/zh-cn/config-reference/sdk.mdx @@ -34,67 +34,10 @@ import { defineStudioCMSConfig } from 'studiocms/config'; // ---cut--- export default defineStudioCMSConfig({ sdk: { - // 默认配置 - 使用5分钟缓存生命周期 + // 默认配置 - 使用默认 5 分钟缓存生命周期 cacheConfig: { - lifetime: '5m', // 缓存有效期(5分钟) + lifetime: '5m', }, } }) -``` - -### 缓存配置详解 - -#### 基本缓存配置选项: - -| 配置项 | 类型 | 描述 | 示例值 | -|-----------|----------|----------------------------------|-------------| -| `lifetime`| `string` | 缓存有效期时间字符串 | `'5m'`(5分钟) | - -#### 时间单位支持: - -- `s` - 秒 (seconds) -- `m` - 分 (minutes) -- `h` - 小时 (hours) -- `d` - 天 (days) - -#### 禁用缓存: - -```ts twoslash {4} title="完全禁用缓存" -import { defineStudioCMSConfig } from 'studiocms/config'; -// ---cut--- -export default defineStudioCMSConfig({ - sdk: { - cacheConfig: false, // 完全禁用SDK缓存 - } -}) -``` - -#### 默认缓存行为: -当不配置 `cacheConfig` 时,SDK 将启用默认缓存策略: -- API响应数据缓存:5分钟 -- 数据库查询结果缓存:2分钟 -- 实时数据(如用户会话)不缓存 - -> **性能提示**:对于内容变动频繁的场景,建议缩短缓存时间(如 `'1m'`)或设置为 `false`。对于静态内容主导的站点,可延长缓存时间(如 `'24h'`)以提升性能。 - -```ts -// 高级缓存配置示例(仅适用于Enterprise版本) -cacheConfig: { - lifetime: '10m', - strategy: 'stale-while-revalidate', // 后台更新策略 - types: { - api: '5m', - database: '10m', - assets: '24h' - } -} -``` - -### 缓存工作原理: -1. 当SDK获取数据时,先检查缓存是否存在有效副本 -2. 若存在且未过期,直接返回缓存数据 -3. 若不存在或已过期,从数据源获取最新数据 -4. 新数据存入缓存并设置有效期 -5. 返回最新数据给调用方 - -所有缓存操作对应用代码透明,开发者无需手动管理缓存生命周期。 \ No newline at end of file +``` \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx b/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx index 2770446d..4c28e3a3 100644 --- a/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx +++ b/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx @@ -60,5 +60,5 @@ import { Steps } from '@astrojs/starlight/components'; 哦,您还会在[贡献者列表][contributors]中看到自己!🎉 -{/* 链接 */} +{/* Links */} [contributors]: /zh-cn/guides/contributing/getting-started/#我们的贡献者 \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/contributing/getting-started.mdx b/src/content/docs/zh-cn/guides/contributing/getting-started.mdx index 1000842f..f391dfb2 100644 --- a/src/content/docs/zh-cn/guides/contributing/getting-started.mdx +++ b/src/content/docs/zh-cn/guides/contributing/getting-started.mdx @@ -23,5 +23,5 @@ import ContributorList from '~/components/ContributorList.astro'; 如果您遇到错误或想建议新功能,请在[GitHub 仓库](https://github.com/withstudiocms/studiocms)上提交问题。创建新问题时,请提供尽可能多的细节,包括重现问题的步骤(针对错误)以及对提议功能的清晰描述。 -{/* 链接 */} +{/* Links */} [how-it-works]: /zh-cn/how-it-works/ \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/contributing/translations.mdx b/src/content/docs/zh-cn/guides/contributing/translations.mdx index 26748315..cd9aed50 100644 --- a/src/content/docs/zh-cn/guides/contributing/translations.mdx +++ b/src/content/docs/zh-cn/guides/contributing/translations.mdx @@ -110,15 +110,12 @@ StudioCMS 正在积极将文档翻译成多种语言,当前重点语言包括 3. **主侧边栏翻译** ➤ `src/starlight-sidebar/{语言代码}.json` -开始前: -1. 检查[翻译追踪器](https://i18n.docs.studiocms.dev/) -2. 查看现有 PR 避免重复 -3. 在 Discord 的 `docs-i18n` 频道声明工作内容 +当你找到目标文件后,请先查阅[翻译追踪清单](https://i18n.docs.studiocms.dev/)和现有PR——可能已经有人在进行翻译。若确认无人认领,请立刻在Discord的`docs-i18n`频道招呼一声,千万别重复劳动! :::note 不确定某内容是否需要翻译?组件如何工作?请查阅[参考文档](/en/config-reference/)。 ::: :::caution -并非所有页面都开放翻译。我们根据页面稳定性逐步开放,**请勿翻译**右侧边栏"贡献"区域没有"翻译此页"按钮的页面。 +并非所有页面都开放翻译。我们根据页面稳定性逐步开放,请勿翻译右侧边栏”贡献“区域没有”翻译此页“按钮的页面。 ::: \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/database/sqld-server.mdx b/src/content/docs/zh-cn/guides/database/sqld-server.mdx index 80bc915d..27707edc 100644 --- a/src/content/docs/zh-cn/guides/database/sqld-server.mdx +++ b/src/content/docs/zh-cn/guides/database/sqld-server.mdx @@ -5,7 +5,7 @@ description: 使用 Docker 托管您的 sqld libSQL 服务器 --- import ReadMore from '~/components/ReadMore.astro' -import { PackageManagers } from 'studiocms-package-managers' +import { PackageManagers } from 'starlight-package-managers' import { FileTree, TabItem, Tabs, Steps, Aside } from '@astrojs/starlight/components'; `sqld`(SQL 守护进程)是由 Turso 开发的 libSQL 服务器模式。本指南将介绍如何通过 Docker 容器设置和配置 `sqld` 以用于 StudioCMS 项目。 @@ -117,17 +117,17 @@ services: -1. **启动 Docker 容器**: +1. 启动 Docker 容器: 在基础目录(或服务器目录)执行: ```sh docker compose up -d ``` -2. **同步数据库架构**: +2. 同步数据库架构: 进入 StudioCMS 项目目录执行: -3. **完成首次设置**: +3. 完成首次设置: 遵循新数据库的首次设置流程: - 参考[入门指南][getting-started] @@ -137,54 +137,11 @@ services: -## 安全加固建议 - -```yml -# 添加安全配置 -environment: - - SQLD_HTTP_TLS_CERT_FILE=/path/to/cert.pem - - SQLD_HTTP_TLS_KEY_FILE=/path/to/key.pem - - SQLD_GRPC_TLS_CERT_FILE=/path/to/cert.pem - - SQLD_GRPC_TLS_KEY_FILE=/path/to/key.pem -``` - -## 性能优化 - -```yml -# 资源限制 -deploy: - resources: - limits: - cpus: '2' - memory: 2G - reservations: - cpus: '0.5' - memory: 512M -``` - -## 故障排查 - -**连接问题**: -```bash -# 测试数据库连接 -curl -v http://localhost:8080 -``` - -**日志查看**: -```bash -docker compose logs -f libsql -``` - -**容器状态检查**: -```bash -docker ps -a -``` - ## 总结 -通过本指南,您已建立了一个安全的自托管 libSQL 服务器环境,为 StudioCMS 项目提供了可靠的数据库支持。此方案特别适合需要完全控制数据环境的场景。 +如果你想为 StudioCMS 自托管 libSQL 数据库,`sqld` 是一个可行的选择。只要采用正确方法,部署和运行过程并不复杂。遵循本指南操作,你将为 StudioCMS 项目获得一个安全的 libSQL 服务器。 -{/* 文档链接 */} +{/* Links */} [sql-docs]: https://github.com/tursodatabase/libsql/blob/main/docs/USER_GUIDE.md [docker-docs]: https://docs.docker.com/get-started/get-docker/ [openssl-docs]: https://docs.openssl.org/3.2/man7/ossl-guide-introduction/#getting-and-installing-openssl diff --git a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx index 7df85f76..cf057b29 100644 --- a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx +++ b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx @@ -41,51 +41,5 @@ import QuickUpdate from '~/components/QuickUpdate.astro' 详细了解 CLI 新功能请参阅[命令行工具文档][cli-docs] -## 升级操作指南 - -### 标准升级流程 -```bash -# 1. 升级 StudioCMS 核心 -npm install studiocms@0.1.0-beta.16 - -# 2. 升级 Astro 版本 -npm install astro@5.7.1 - -# 3. 运行升级命令 -npx @studiocms/upgrade -``` - -### 数据库迁移 -```bash -# 应用数据库变更 -npx astro db push -``` - -### 密码重置建议 -```bash -# 批量发送密码重置通知 -studiocms users reset-passwords --notify-all -``` - -## 注意事项 - -1. **兼容性检查**: - ```bash - npx astro check - ``` - -2. **回滚方案**: - ```bash - # 安装旧版核心 - npm install studiocms@0.1.0-beta.15 - - # 恢复数据库备份 - npx astro db restore backup.sql - ``` - -3. **插件兼容性**: - - 使用 `studiocms add` 安装的插件自动兼容新版本 - - 手动安装的插件需验证兼容性 - -{/* 文档链接 */} +{/* Links */} [cli-docs]: /zh-cn/how-it-works/cli/ \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx index a402b95d..56ba8cdc 100644 --- a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx +++ b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx @@ -1,10 +1,10 @@ --- i18nReady: true -title: "升级指南:0.1.0-beta.17" -description: StudioCMS Beta.17 版本升级说明 +title: "更新指南:0.1.0-beta.17" +description: "升级到 StudioCMS Beta.17" sidebar: label: 0.1.0-beta.17 - order: 999998 + order: 999998 # 侧边栏排序值 --- import ReadMore from '~/components/ReadMore.astro' @@ -13,88 +13,20 @@ import { Aside } from '@astrojs/starlight/components' -此版本无重大变更,主要进行了多项性能优化和稳定性改进,提升整体用户体验。 +此版本虽无重大变更,但我们进行了多项优化与问题修复,全面提升了 StudioCMS 的性能和稳定性。 -## 更新概览 +## 版本更新摘要 -- **新功能** +- **新增功能** - 仪表板新增用户反馈系统 - ```mermaid - graph LR - A[用户提交反馈] --> B[系统收集] - B --> C[自动分类] - C --> D[开发团队处理] - ``` - - **问题修复** - - 修复了 Astro Fonts 的相关问题 - - 优化了 CLI 命令 [`crypto gen-jwt`](/en/how-it-works/cli/#crypto-gen-jwt) 的密钥路径检测逻辑 - -- **性能改进** - - 使用 [deepmerge-ts](https://www.npmjs.com/package/deepmerge-ts) 替换 [lodash](https://www.npmjs.com/package/lodash) 提升数据处理效率 - - 优化中间件的 Promise 处理流程 - - 重构权限级别处理逻辑 + - 解决 Astro 字体渲染问题 + - 优化 [`crypto gen-jwt`](/en/how-it-works/cli/#crypto-gen-jwt) CLI 命令的密钥文件路径检测 +- **性能优化** + - 将 [lodash](https://www.npmjs.com/package/lodash) 替换为 [deepmerge-ts](https://www.npmjs.com/package/deepmerge-ts) 提升性能 + - 优化中间件的 Promise 处理逻辑 + - 改进权限等级处理机制 - -## 升级指南 - -### 推荐步骤 - -```bash -# 1. 升级 StudioCMS 核心 -npm install studiocms@0.1.0-beta.17 - -# 2. 更新依赖库 -npm update - -# 3. 应用数据库变更 -npx astro db push - -# 4. 清理构建缓存 -rm -rf .astro dist node_modules/.cache -``` - -### 密码更新建议 - -```bash -# 强制用户下次登录时更新密码 -studiocms users require-password-reset --all - -# 批量发送密码重置通知 -studiocms users send-reset-links -``` - -## 性能对比 - -更新前后关键指标对比: - -| 指标 | beta.16 | beta.17 | 提升 | -|------|---------|---------|------| -| 仪表板加载时间 | 420ms | 320ms | ↓23% | -| 用户认证延迟 | 150ms | 95ms | ↓36% | -| 内存占用峰值 | 85MB | 72MB | ↓15% | - -## 已知问题及解决方案 - -1. **字体加载异常**: - ```ts - // 在 astro.config.mjs 中添加 - export default defineConfig({ - vite: { - optimizeDeps: { - exclude: ['@astropub/web-fonts'] - } - } - }); - ``` - -2. **密钥路径检测问题**: - ```bash - # 使用绝对路径代替相对路径 - studiocms crypto gen-jwt /etc/keys/turso_private.pem - ``` - -此版本继续推进密码安全策略升级,强烈建议用户按照提示更新密码以保障系统安全。 \ No newline at end of file +注意:自 `beta.16` 起我们变更了密码哈希算法。尽管旧密码仍可正常使用,但强烈建议用户在升级至 `beta.17` 后更新密码。旧版密码哈希支持将在后续版本中移除。 + \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx index bb0e6c99..87f290c7 100644 --- a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx +++ b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx @@ -1,13 +1,13 @@ --- i18nReady: true title: "升级指南:0.1.0-beta.18" -description: StudioCMS Beta.18 版本升级说明 +description: "升级到 StudioCMS Beta.18" sidebar: label: 0.1.0-beta.18 badge: - text: 最新版 + text: 新版 # 保留徽章样式 variant: success - order: 999997 + order: 999997 # 侧边栏排序值 --- import ReadMore from '~/components/ReadMore.astro' @@ -18,99 +18,16 @@ import { Aside } from '@astrojs/starlight/components' ## 重大变更 -- **全新插件系统**:引入基于钩子(Hook)的插件架构 - ```ts - // 旧版插件定义 - export const myPlugin = { /* 配置对象 */ } - - // 新版钩子式插件 - export default definePlugin((options) => ({ - hooks: { - 'studiocms:config:setup': ({ setDashboard }) => { - // 插件初始化逻辑 - } - } - })) - ``` - 查看全新[插件文档][plugin-doc]了解迁移指南 +- 全新的基于 Hook 的插件系统 - 详见更新版[插件文档][plugin-doc] -## 问题修复 +## 错误修复 -- **`gen-jwt` 命令重构**: - - 修复密钥解析逻辑 - - 增强错误处理机制 - - 支持环境变量注入 - ```bash - # 新用法示例 - STUDIOCMS_JWT_EXP=3600 studiocms crypto gen-jwt ./keys/private.pem - ``` - 查看更新后的[CLI文档][cli-doc]获取详细说明 +- 重构 `gen-jwt` 命令 - 详见更新版[CLI文档][cli-doc] - {/* Links */} -[plugin-doc]: /en/plugins/ -[cli-doc]: /en/how-it-works/cli/#crypto-gen-jwt \ No newline at end of file +[plugin-doc]: /zh-cn/plugins/ +[cli-doc]: /zh-cn/how-it-works/cli/#crypto-gen-jwt \ No newline at end of file diff --git a/src/content/docs/zh-cn/how-it-works/index.mdx b/src/content/docs/zh-cn/how-it-works/index.mdx index deda1a40..0e64b5e0 100644 --- a/src/content/docs/zh-cn/how-it-works/index.mdx +++ b/src/content/docs/zh-cn/how-it-works/index.mdx @@ -8,7 +8,7 @@ sidebar: # 架构解析 -StudioCMS 是专为 Astro 构建的强大 CMS 系统,基于 [Astro DB](https://docs.astro.build/en/guides/astro-db/) 实现内容管理与服务。其设计兼具易用性与灵活性,能处理各种类型的内容需求。 +StudioCMS 是专为 Astro 构建的强大 CMS 系统,基于 [Astro DB](https://docs.astro.build/zh-cn/guides/astro-db/) 实现内容管理与服务。其设计兼具易用性与灵活性,能处理各种类型的内容需求。 扩展 StudioCMS 非常简单!您可以创建自定义插件来增强系统功能。StudioCMS 集成是整个生态系统的基石,为 Astro 项目提供无头 CMS 解决方案。以下是其核心组件的详细解析。 diff --git a/src/content/docs/zh-cn/how-it-works/sdk.mdx b/src/content/docs/zh-cn/how-it-works/sdk.mdx index 396d163a..caccfb49 100644 --- a/src/content/docs/zh-cn/how-it-works/sdk.mdx +++ b/src/content/docs/zh-cn/how-it-works/sdk.mdx @@ -147,7 +147,7 @@ import SDK from 'studiocms:sdk'; const { db } = SDK; ``` -有关如何使用 `db` 的更多信息,请查看 [Astro DB 指南](https://docs.astro.build/en/guides/astro-db/) +有关如何使用 `db` 的更多信息,请查看 [Astro DB 指南](https://docs.astro.build/zh-cn/guides/astro-db/) ### `SDK.REST_API` diff --git a/src/content/docs/zh-cn/plugins/extended.mdx b/src/content/docs/zh-cn/plugins/extended.mdx index e107da0a..dccd561b 100644 --- a/src/content/docs/zh-cn/plugins/extended.mdx +++ b/src/content/docs/zh-cn/plugins/extended.mdx @@ -131,7 +131,7 @@ export function studioCMSPageInjector(options: Options) { 上述示例定义了一个包含 Astro 集成的 StudioCMS 插件,用于构建基础博客系统。该插件通过以下核心功能扩展 StudioCMS: -深入了解 Astro 集成开发,请参阅 [Astro 集成套件](https://astro-integration-kit.netlify.app/) 和 [Astro 集成文档](https://docs.astro.build/en/reference/integrations-reference/) +深入了解 Astro 集成开发,请参阅 [Astro 集成套件](https://astro-integration-kit.netlify.app/) 和 [Astro 集成文档](https://docs.astro.build/zh-cn/reference/integrations-reference/) ## 路由实现示例 @@ -195,7 +195,7 @@ const page = pages.find((page) => page.slug === slug || ''); } ``` -此[动态路由](https://docs.astro.build/en/guides/routing/#dynamic-routes)在没有 slug 参数时显示文章列表,有 slug 时显示具体文章内容。 +此[动态路由](https://docs.astro.build/zh-cn/guides/routing/#dynamic-routes)在没有 slug 参数时显示文章列表,有 slug 时显示具体文章内容。 ## 仪表板组件示例 diff --git a/src/content/docs/zh-cn/start-here/environment-variables.mdx b/src/content/docs/zh-cn/start-here/environment-variables.mdx index bb5fd47c..eb12404a 100644 --- a/src/content/docs/zh-cn/start-here/environment-variables.mdx +++ b/src/content/docs/zh-cn/start-here/environment-variables.mdx @@ -27,7 +27,7 @@ ASTRO_DB_REMOTE_URL=libsql://your.server.io ASTRO_DB_APP_TOKEN=eyJh...RUCg ``` -有关 `@astrojs/db` 的详细信息,请参阅 [Astro DB 文档](https://docs.astro.build/en/guides/astro-db/) +有关 `@astrojs/db` 的详细信息,请参阅 [Astro DB 文档](https://docs.astro.build/zh-cn/guides/astro-db/) ### `@studiocms/auth` 加密密钥 diff --git a/src/content/docs/zh-cn/start-here/getting-started.mdx b/src/content/docs/zh-cn/start-here/getting-started.mdx index 3690e40d..8e8407c8 100644 --- a/src/content/docs/zh-cn/start-here/getting-started.mdx +++ b/src/content/docs/zh-cn/start-here/getting-started.mdx @@ -12,13 +12,13 @@ import { Aside, Steps, Tabs, TabItem, LinkCard } from '@astrojs/starlight/compon import ReadMore from '~/components/ReadMore.astro'; import { sponsors, SponsorLink } from '~/share-link' - + ## 开始前的准备工作 使用 StudioCMS 需要满足以下条件: -- 支持 Astro 的 [Node.js 版本](https://docs.astro.build/en/install-and-setup/#prerequisites)(不支持 Bun 和 Deno) +- 支持 Astro 的 [Node.js 版本](https://docs.astro.build/zh-cn/install-and-setup/#prerequisites)(不支持 Bun 和 Deno) - 一个 Astro 项目 - libSQL 数据库提供商或[自托管 libSQL 服务器][self-hosted-libsql] - StudioCMS 集成 @@ -72,7 +72,7 @@ libSQL 同时支持 HTTP 和 WebSockets 作为远程服务器的传输协议, 有关所需环境变量的详细信息,请参阅[数据库连接参数][db-url-token] -了解所有 libSQL 选项(包括本地文件),请参阅 [Astro 文档:远程 URL 配置选项](https://docs.astro.build/en/guides/astro-db/#remote-url-configuration-options) +了解所有 libSQL 选项(包括本地文件),请参阅 [Astro 文档:远程 URL 配置选项](https://docs.astro.build/zh-cn/guides/astro-db/#remote-url-configuration-options) ## 创建 StudioCMS 项目 @@ -197,7 +197,7 @@ libSQL 同时支持 HTTP 和 WebSockets 作为远程服务器的传输协议, 在配置 StudioCMS `时需特别注意:astro.config.mjs` 文件中的 ​`site` 配置项是必需参数,必须设置为您的站点实际 URL 或临时占位 URL 才能确保系统正常运行。(例如:`https://demo.studiocms.dev/` 或 `http://localhost:4321/`) ## 配置认证 diff --git a/src/starlight-sidebar/availTranslations.ts b/src/starlight-sidebar/availTranslations.ts index 69aafc24..783c24ee 100644 --- a/src/starlight-sidebar/availTranslations.ts +++ b/src/starlight-sidebar/availTranslations.ts @@ -1 +1 @@ -export const Translations = ['en', 'es', 'fr', 'ko', 'de', 'zh-cn'] as const; +export const Translations = ['en', 'es', 'fr', 'ko', 'de', 'zh-CN'] as const; From a520013d8a1bc5f377e1314bef35e4ab78ed2af8 Mon Sep 17 00:00:00 2001 From: Jenxi Seow Date: Sat, 7 Jun 2025 16:57:46 +0800 Subject: [PATCH 14/25] Rename zh-cn.json to zh-CN.json --- src/content/i18n/{zh-cn.json => zh-CN.json} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/content/i18n/{zh-cn.json => zh-CN.json} (99%) diff --git a/src/content/i18n/zh-cn.json b/src/content/i18n/zh-CN.json similarity index 99% rename from src/content/i18n/zh-cn.json rename to src/content/i18n/zh-CN.json index 46580acf..9ac52cfd 100644 --- a/src/content/i18n/zh-cn.json +++ b/src/content/i18n/zh-CN.json @@ -46,4 +46,4 @@ "docsearch.noResultsScreen.reportMissingResultsText": "认为该查询应有结果?", "docsearch.noResultsScreen.reportMissingResultsLinkText": "请告知我们", "quick-update": "运行以下命令快速更新至最新版本:" -} \ No newline at end of file +} From 9bdde95d6c6a986b7671a965eaf9f0d6cd3bf86d Mon Sep 17 00:00:00 2001 From: Jenxi Seow Date: Sat, 7 Jun 2025 16:59:55 +0800 Subject: [PATCH 15/25] Rename zh-CN.json to zh-cn.json --- src/content/i18n/{zh-CN.json => zh-cn.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/content/i18n/{zh-CN.json => zh-cn.json} (100%) diff --git a/src/content/i18n/zh-CN.json b/src/content/i18n/zh-cn.json similarity index 100% rename from src/content/i18n/zh-CN.json rename to src/content/i18n/zh-cn.json From da04fc33db1def48f483b71de292ef6266d03cab Mon Sep 17 00:00:00 2001 From: Jenxi Date: Sat, 7 Jun 2025 17:26:19 +0800 Subject: [PATCH 16/25] Fixed links to use zh-cn --- .../zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx | 2 +- .../zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx | 2 +- .../zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx | 4 ++-- src/content/docs/zh-cn/plugins/extended.mdx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx index cf057b29..195697c6 100644 --- a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx +++ b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx @@ -42,4 +42,4 @@ import QuickUpdate from '~/components/QuickUpdate.astro' 详细了解 CLI 新功能请参阅[命令行工具文档][cli-docs] {/* Links */} -[cli-docs]: /zh-cn/how-it-works/cli/ \ No newline at end of file +[cli-docs]: /zh-CN/how-it-works/cli/ \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx index 77e44af5..8b9edce8 100644 --- a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx +++ b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx @@ -21,7 +21,7 @@ import { Aside } from '@astrojs/starlight/components' - 仪表板新增用户反馈系统 - **问题修复** - 解决 Astro 字体渲染问题 - - 优化 [`crypto gen-jwt`](/zh-cn/how-it-works/cli/#crypto-gen-jwt) CLI 命令的密钥文件路径检测 + - 优化 [`crypto gen-jwt`](/zh-CN/how-it-works/cli/#crypto-gen-jwt) CLI 命令的密钥文件路径检测 - **性能优化** - 将 [lodash](https://www.npmjs.com/package/lodash) 替换为 [deepmerge-ts](https://www.npmjs.com/package/deepmerge-ts) 提升性能 - 优化中间件的 Promise 处理逻辑 diff --git a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx index 64d567cf..ef851f42 100644 --- a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx +++ b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx @@ -29,5 +29,5 @@ import { Aside } from '@astrojs/starlight/components' {/* Links */} -[plugin-doc]: /zh-cn/plugins/ -[cli-doc]: /zh-cn/how-it-works/cli/#crypto-gen-jwt \ No newline at end of file +[plugin-doc]: /zh-CN/plugins/ +[cli-doc]: /zh-CN/how-it-works/cli/#crypto-gen-jwt \ No newline at end of file diff --git a/src/content/docs/zh-cn/plugins/extended.mdx b/src/content/docs/zh-cn/plugins/extended.mdx index dccd561b..ad1850c4 100644 --- a/src/content/docs/zh-cn/plugins/extended.mdx +++ b/src/content/docs/zh-cn/plugins/extended.mdx @@ -131,7 +131,7 @@ export function studioCMSPageInjector(options: Options) { 上述示例定义了一个包含 Astro 集成的 StudioCMS 插件,用于构建基础博客系统。该插件通过以下核心功能扩展 StudioCMS: -深入了解 Astro 集成开发,请参阅 [Astro 集成套件](https://astro-integration-kit.netlify.app/) 和 [Astro 集成文档](https://docs.astro.build/zh-cn/reference/integrations-reference/) +深入了解 Astro 集成开发,请参阅 [Astro 集成套件](https://astro-integration-kit.netlify.app/) 和 [Astro 集成文档](https://docs.astro.build/zh-CN/reference/integrations-reference/) ## 路由实现示例 From 62ca6aac99647b6ec33fe38879ac91785104cf2b Mon Sep 17 00:00:00 2001 From: Jenxi Date: Sat, 7 Jun 2025 17:28:45 +0800 Subject: [PATCH 17/25] Fixed links to use zh-cn --- .../guides/contributing/code-contributions.mdx | 16 ++++++++-------- .../zh-cn/guides/contributing/translations.mdx | 2 +- .../upgrade/version-guides/0-1-0-beta-16.mdx | 2 +- .../upgrade/version-guides/0-1-0-beta-17.mdx | 2 +- src/content/docs/zh-cn/plugins/extended.mdx | 2 +- .../zh-cn/start-here/environment-variables.mdx | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx b/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx index 234e6fec..f9725b0c 100644 --- a/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx +++ b/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx @@ -21,11 +21,11 @@ import { Steps } from '@astrojs/starlight/components'; 1. **分叉仓库** - 使用 GitHub Desktop: - - [GitHub Desktop 入门指南](https://docs.github.com/zh-cn/desktop/installing-and-configuring-github-desktop/getting-started-with-github-desktop)将引导您设置 Desktop - - 设置完成后,您可以用它来[分叉仓库](https://docs.github.com/zh-cn/desktop/contributing-and-collaborating-using-github-desktop/cloning-and-forking-repositories-from-github-desktop)! + - [GitHub Desktop 入门指南](https://docs.github.com/zh-CN/desktop/installing-and-configuring-github-desktop/getting-started-with-github-desktop)将引导您设置 Desktop + - 设置完成后,您可以用它来[分叉仓库](https://docs.github.com/zh-CN/desktop/contributing-and-collaborating-using-github-desktop/cloning-and-forking-repositories-from-github-desktop)! - 使用命令行: - - [分叉仓库](https://docs.github.com/zh-cn/github/getting-started-with-github/fork-a-repo#fork-an-example-repository),这样您可以在准备好合并更改前不影响原始项目 + - [分叉仓库](https://docs.github.com/zh-CN/github/getting-started-with-github/fork-a-repo#fork-an-example-repository),这样您可以在准备好合并更改前不影响原始项目 2. **安装或更新 Node.js 和 pnpm**,版本需符合 [`.prototools`](https://github.com/withstudiocms/studiocms/blob/main/.prototools) 中的指定要求 @@ -44,12 +44,12 @@ import { Steps } from '@astrojs/starlight/components'; 完成更改后,创建拉取请求(也称为 PR)。 - 填写"准备审核"模板,以便我们审核您的 PR。此模板帮助审核者理解您的更改以及 PR 的目的 -- 如果您正在解决问题,别忘了[将 PR 链接到问题](https://docs.github.com/zh-cn/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) -- 启用[允许维护者编辑](https://docs.github.com/zh-cn/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)复选框,以便可以更新分支进行合并 +- 如果您正在解决问题,别忘了[将 PR 链接到问题](https://docs.github.com/zh-CN/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) +- 启用[允许维护者编辑](https://docs.github.com/zh-CN/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork)复选框,以便可以更新分支进行合并 提交 PR 后,文档团队成员将审核您的提案。我们可能会提出问题或要求提供额外信息。 -- 在 PR 合并前,我们可能会要求进行更改,可能使用[建议的更改](https://docs.github.com/zh-cn/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request)或 PR 评论。您可以直接通过 UI 应用建议的更改。您可以在自己的分叉中进行任何其他更改,然后将它们提交到您的分支 -- 当您更新 PR 并应用更改时,将每个对话标记为[已解决](https://docs.github.com/zh-cn/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations) +- 在 PR 合并前,我们可能会要求进行更改,可能使用[建议的更改](https://docs.github.com/zh-CN/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request)或 PR 评论。您可以直接通过 UI 应用建议的更改。您可以在自己的分叉中进行任何其他更改,然后将它们提交到您的分支 +- 当您更新 PR 并应用更改时,将每个对话标记为[已解决](https://docs.github.com/zh-CN/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations) - 如果遇到任何合并问题,请查看此 [Git 教程](https://github.com/skills/resolve-merge-conflicts)以帮助您解决合并冲突和其他问题 ## 您的 PR 已合并! @@ -61,4 +61,4 @@ import { Steps } from '@astrojs/starlight/components'; 哦,您还会在[贡献者列表][contributors]中看到自己!🎉 {/* Links */} -[contributors]: /zh-cn/guides/contributing/getting-started/#我们的贡献者 \ No newline at end of file +[contributors]: /zh-CN/guides/contributing/getting-started/#我们的贡献者 \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/contributing/translations.mdx b/src/content/docs/zh-cn/guides/contributing/translations.mdx index 8b72591d..b2e09dd4 100644 --- a/src/content/docs/zh-cn/guides/contributing/translations.mdx +++ b/src/content/docs/zh-cn/guides/contributing/translations.mdx @@ -113,7 +113,7 @@ StudioCMS 正在积极将文档翻译成多种语言,当前重点语言包括 当你找到目标文件后,请先查阅[翻译追踪清单](https://i18n.docs.studiocms.dev/)和现有PR——可能已经有人在进行翻译。若确认无人认领,请立刻在Discord的`docs-i18n`频道招呼一声,千万别重复劳动! :::note -不确定某内容是否需要翻译?组件如何工作?请查阅[参考文档](/zh-cn/config-reference/)。 +不确定某内容是否需要翻译?组件如何工作?请查阅[参考文档](/zh-CN/config-reference/)。 ::: :::caution diff --git a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx index 195697c6..cf057b29 100644 --- a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx +++ b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-16.mdx @@ -42,4 +42,4 @@ import QuickUpdate from '~/components/QuickUpdate.astro' 详细了解 CLI 新功能请参阅[命令行工具文档][cli-docs] {/* Links */} -[cli-docs]: /zh-CN/how-it-works/cli/ \ No newline at end of file +[cli-docs]: /zh-cn/how-it-works/cli/ \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx index 8b9edce8..77e44af5 100644 --- a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx +++ b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-17.mdx @@ -21,7 +21,7 @@ import { Aside } from '@astrojs/starlight/components' - 仪表板新增用户反馈系统 - **问题修复** - 解决 Astro 字体渲染问题 - - 优化 [`crypto gen-jwt`](/zh-CN/how-it-works/cli/#crypto-gen-jwt) CLI 命令的密钥文件路径检测 + - 优化 [`crypto gen-jwt`](/zh-cn/how-it-works/cli/#crypto-gen-jwt) CLI 命令的密钥文件路径检测 - **性能优化** - 将 [lodash](https://www.npmjs.com/package/lodash) 替换为 [deepmerge-ts](https://www.npmjs.com/package/deepmerge-ts) 提升性能 - 优化中间件的 Promise 处理逻辑 diff --git a/src/content/docs/zh-cn/plugins/extended.mdx b/src/content/docs/zh-cn/plugins/extended.mdx index ad1850c4..dccd561b 100644 --- a/src/content/docs/zh-cn/plugins/extended.mdx +++ b/src/content/docs/zh-cn/plugins/extended.mdx @@ -131,7 +131,7 @@ export function studioCMSPageInjector(options: Options) { 上述示例定义了一个包含 Astro 集成的 StudioCMS 插件,用于构建基础博客系统。该插件通过以下核心功能扩展 StudioCMS: -深入了解 Astro 集成开发,请参阅 [Astro 集成套件](https://astro-integration-kit.netlify.app/) 和 [Astro 集成文档](https://docs.astro.build/zh-CN/reference/integrations-reference/) +深入了解 Astro 集成开发,请参阅 [Astro 集成套件](https://astro-integration-kit.netlify.app/) 和 [Astro 集成文档](https://docs.astro.build/zh-cn/reference/integrations-reference/) ## 路由实现示例 diff --git a/src/content/docs/zh-cn/start-here/environment-variables.mdx b/src/content/docs/zh-cn/start-here/environment-variables.mdx index eb12404a..2d93122e 100644 --- a/src/content/docs/zh-cn/start-here/environment-variables.mdx +++ b/src/content/docs/zh-cn/start-here/environment-variables.mdx @@ -27,7 +27,7 @@ ASTRO_DB_REMOTE_URL=libsql://your.server.io ASTRO_DB_APP_TOKEN=eyJh...RUCg ``` -有关 `@astrojs/db` 的详细信息,请参阅 [Astro DB 文档](https://docs.astro.build/zh-cn/guides/astro-db/) +有关 `@astrojs/db` 的详细信息,请参阅 [Astro DB 文档](https://docs.astro.build/zh-CN/guides/astro-db/) ### `@studiocms/auth` 加密密钥 @@ -107,4 +107,4 @@ CMS_CLOUDINARY_CLOUDNAME="demo" ``` {/* Links */} -[config-oauth]: /zh-cn/start-here/getting-started/#optional-configure-oauth-authentication \ No newline at end of file +[config-oauth]: /zh-CN/start-here/getting-started/#optional-configure-oauth-authentication \ No newline at end of file From e0846c77377b6f51cffac1f6d70af53eff67bb0f Mon Sep 17 00:00:00 2001 From: Jenxi Date: Sat, 7 Jun 2025 17:32:27 +0800 Subject: [PATCH 18/25] Fixed links to use zh-cn --- src/content/docs/zh-cn/guides/index.mdx | 2 +- .../zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx | 4 ++-- src/content/docs/zh-cn/how-it-works/index.mdx | 2 +- src/content/docs/zh-cn/how-it-works/sdk.mdx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/content/docs/zh-cn/guides/index.mdx b/src/content/docs/zh-cn/guides/index.mdx index e408e27b..128a1485 100644 --- a/src/content/docs/zh-cn/guides/index.mdx +++ b/src/content/docs/zh-cn/guides/index.mdx @@ -12,7 +12,7 @@ description: StudioCMS 使用教程和开发指南 ## 升级指南 -- [发布说明](/zh-cn/guides/upgrade/release-notes/) - 从 StudioCMS 更新日志自动生成的发布说明 +- [发布说明](/en/guides/upgrade/release-notes/) - 从 StudioCMS 更新日志自动生成的发布说明 - 更多版本特定指南请查看侧边栏导航 ## 数据库指南 diff --git a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx index ef851f42..64d567cf 100644 --- a/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx +++ b/src/content/docs/zh-cn/guides/upgrade/version-guides/0-1-0-beta-18.mdx @@ -29,5 +29,5 @@ import { Aside } from '@astrojs/starlight/components' {/* Links */} -[plugin-doc]: /zh-CN/plugins/ -[cli-doc]: /zh-CN/how-it-works/cli/#crypto-gen-jwt \ No newline at end of file +[plugin-doc]: /zh-cn/plugins/ +[cli-doc]: /zh-cn/how-it-works/cli/#crypto-gen-jwt \ No newline at end of file diff --git a/src/content/docs/zh-cn/how-it-works/index.mdx b/src/content/docs/zh-cn/how-it-works/index.mdx index 0e64b5e0..2c81bbd9 100644 --- a/src/content/docs/zh-cn/how-it-works/index.mdx +++ b/src/content/docs/zh-cn/how-it-works/index.mdx @@ -1,7 +1,7 @@ --- i18nReady: true title: "核心集成架构" -description: "深入解析 StudioCMS 如何通过其核心组件管理和交付内容" +description: 深入解析 StudioCMS 如何通过其核心组件管理和交付内容 sidebar: order: 1 --- diff --git a/src/content/docs/zh-cn/how-it-works/sdk.mdx b/src/content/docs/zh-cn/how-it-works/sdk.mdx index caccfb49..def6cf15 100644 --- a/src/content/docs/zh-cn/how-it-works/sdk.mdx +++ b/src/content/docs/zh-cn/how-it-works/sdk.mdx @@ -1,7 +1,7 @@ --- i18nReady: true title: "SDK" -description: "了解 StudioCMS SDK 及其使用方法。" +description: 了解 StudioCMS SDK 及其使用方法 sidebar: order: 3 --- From 74c1b89812f8a5e3046985260178afa35d7b3412 Mon Sep 17 00:00:00 2001 From: Jenxi Seow Date: Thu, 12 Jun 2025 16:36:22 +0800 Subject: [PATCH 19/25] Rename zh-cn.json to zh-CN.json --- src/starlight-sidebar/{zh-cn.json => zh-CN.json} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/starlight-sidebar/{zh-cn.json => zh-CN.json} (99%) diff --git a/src/starlight-sidebar/zh-cn.json b/src/starlight-sidebar/zh-CN.json similarity index 99% rename from src/starlight-sidebar/zh-cn.json rename to src/starlight-sidebar/zh-CN.json index 82f80174..d2c43a2b 100644 --- a/src/starlight-sidebar/zh-cn.json +++ b/src/starlight-sidebar/zh-CN.json @@ -18,4 +18,4 @@ "upgrade": "版本升级", "version": "版本指南", "latest": "最新升级指南" -} \ No newline at end of file +} From 133ea01ffb1f86f13017540cfbbeca5ef415ac73 Mon Sep 17 00:00:00 2001 From: Jenxi Seow Date: Thu, 12 Jun 2025 16:36:33 +0800 Subject: [PATCH 20/25] Rename zh-cn.json to zh-CN.json --- src/content/i18n/{zh-cn.json => zh-CN.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/content/i18n/{zh-cn.json => zh-CN.json} (100%) diff --git a/src/content/i18n/zh-cn.json b/src/content/i18n/zh-CN.json similarity index 100% rename from src/content/i18n/zh-cn.json rename to src/content/i18n/zh-CN.json From 285e3a255628ecfa80fa9dcdf421469883cf113c Mon Sep 17 00:00:00 2001 From: Jenxi Date: Thu, 3 Jul 2025 15:25:05 +0800 Subject: [PATCH 21/25] Fixed invalid links --- .../zh-cn/config-reference/included-integrations.mdx | 2 +- .../zh-cn/guides/contributing/code-contributions.mdx | 2 +- .../docs/zh-cn/guides/contributing/translations.mdx | 2 +- src/content/docs/zh-cn/guides/database/sqld-server.mdx | 2 +- src/content/docs/zh-cn/how-it-works/cli.mdx | 2 +- .../docs/zh-cn/start-here/environment-variables.mdx | 2 +- src/content/docs/zh-cn/start-here/getting-started.mdx | 10 +++++----- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/content/docs/zh-cn/config-reference/included-integrations.mdx b/src/content/docs/zh-cn/config-reference/included-integrations.mdx index e6d6e501..9d02664e 100644 --- a/src/content/docs/zh-cn/config-reference/included-integrations.mdx +++ b/src/content/docs/zh-cn/config-reference/included-integrations.mdx @@ -39,7 +39,7 @@ export default defineStudioCMSConfig({ }) ``` -##### `RobotsConfig` 配置接口 +##### `RobotsConfig` ```ts interface RobotsConfig { diff --git a/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx b/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx index f9725b0c..3a141a85 100644 --- a/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx +++ b/src/content/docs/zh-cn/guides/contributing/code-contributions.mdx @@ -61,4 +61,4 @@ import { Steps } from '@astrojs/starlight/components'; 哦,您还会在[贡献者列表][contributors]中看到自己!🎉 {/* Links */} -[contributors]: /zh-CN/guides/contributing/getting-started/#我们的贡献者 \ No newline at end of file +[contributors]: /zh-cn/guides/contributing/getting-started/#我们的贡献者 \ No newline at end of file diff --git a/src/content/docs/zh-cn/guides/contributing/translations.mdx b/src/content/docs/zh-cn/guides/contributing/translations.mdx index b2e09dd4..8b72591d 100644 --- a/src/content/docs/zh-cn/guides/contributing/translations.mdx +++ b/src/content/docs/zh-cn/guides/contributing/translations.mdx @@ -113,7 +113,7 @@ StudioCMS 正在积极将文档翻译成多种语言,当前重点语言包括 当你找到目标文件后,请先查阅[翻译追踪清单](https://i18n.docs.studiocms.dev/)和现有PR——可能已经有人在进行翻译。若确认无人认领,请立刻在Discord的`docs-i18n`频道招呼一声,千万别重复劳动! :::note -不确定某内容是否需要翻译?组件如何工作?请查阅[参考文档](/zh-CN/config-reference/)。 +不确定某内容是否需要翻译?组件如何工作?请查阅[参考文档](/zh-cn/config-reference/)。 ::: :::caution diff --git a/src/content/docs/zh-cn/guides/database/sqld-server.mdx b/src/content/docs/zh-cn/guides/database/sqld-server.mdx index 27707edc..2b03e476 100644 --- a/src/content/docs/zh-cn/guides/database/sqld-server.mdx +++ b/src/content/docs/zh-cn/guides/database/sqld-server.mdx @@ -145,4 +145,4 @@ services: [sql-docs]: https://github.com/tursodatabase/libsql/blob/main/docs/USER_GUIDE.md [docker-docs]: https://docs.docker.com/get-started/get-docker/ [openssl-docs]: https://docs.openssl.org/3.2/man7/ossl-guide-introduction/#getting-and-installing-openssl -[getting-started]: /zh-cn/start-here/getting-started/#first-time-setup-or-during-updates-if-the-tables-schema-is-updated \ No newline at end of file +[getting-started]: /zh-cn/start-here/getting-started/#首次设置或数据表结构更新时 \ No newline at end of file diff --git a/src/content/docs/zh-cn/how-it-works/cli.mdx b/src/content/docs/zh-cn/how-it-works/cli.mdx index 27fffb16..047d6dd4 100644 --- a/src/content/docs/zh-cn/how-it-works/cli.mdx +++ b/src/content/docs/zh-cn/how-it-works/cli.mdx @@ -270,7 +270,7 @@ Turso CLI 安装器 -h, --help 显示命令帮助信息 ``` -## `@studiocms/upgrade` +## `@studiocms-upgrade` 专用于升级 StudioCMS 运行环境和依赖项的命令行工具。 diff --git a/src/content/docs/zh-cn/start-here/environment-variables.mdx b/src/content/docs/zh-cn/start-here/environment-variables.mdx index 2d93122e..a3109f0e 100644 --- a/src/content/docs/zh-cn/start-here/environment-variables.mdx +++ b/src/content/docs/zh-cn/start-here/environment-variables.mdx @@ -107,4 +107,4 @@ CMS_CLOUDINARY_CLOUDNAME="demo" ``` {/* Links */} -[config-oauth]: /zh-CN/start-here/getting-started/#optional-configure-oauth-authentication \ No newline at end of file +[config-oauth]: /zh-cn/start-here/getting-started/#可选配置-oauth-认证 \ No newline at end of file diff --git a/src/content/docs/zh-cn/start-here/getting-started.mdx b/src/content/docs/zh-cn/start-here/getting-started.mdx index 8e8407c8..94e0c384 100644 --- a/src/content/docs/zh-cn/start-here/getting-started.mdx +++ b/src/content/docs/zh-cn/start-here/getting-started.mdx @@ -274,7 +274,7 @@ oAuth 提供商需要设置回调 URL(用户认证后的重定向路径)。 运行命令后,您将看到项目在 `localhost:4321` 运行的消息。首次设置时,请访问 `http://localhost:4321/start` 完成 StudioCMS 配置。 @@ -315,7 +315,7 @@ export default defineStudioCMSConfig({ ### 构建和部署 StudioCMS 项目 -完成[首次设置](#first-time-setup-or-during-updates-if-the-tables-schema-is-updated)后,即可构建并部署项目到服务器。 +完成[首次设置](#首次设置或数据表结构更新时)后,即可构建并部署项目到服务器。 默认情况下,StudioCMS 仪表板位于 `http://your-domain.tld/dashboard`。 @@ -341,8 +341,8 @@ export default defineStudioCMSConfig({ [package-catalog]: /zh-cn/package-catalog/ [environment-variables]: /zh-cn/start-here/environment-variables/ [config-reference]: /zh-cn/config-reference/ -[db-url-token]: /zh-cn/start-here/environment-variables/#database-url-and-token-for-astrojsdb -[encryption-key]: /zh-cn/start-here/environment-variables/#encryption-key-for-studiocmsauth -[oauth-environment-variables]: /zh-cn/start-here/environment-variables/#oauth-authentication-environment-variables +[db-url-token]: /zh-cn/start-here/environment-variables/#astrojsdb-数据库连接参数 +[encryption-key]: /zh-cn/start-here/environment-variables/#http://localhost:4322/zh-cn/start-here/environment-variables/#studiocmsauth-加密密钥 +[oauth-environment-variables]: /zh-cn/start-here/environment-variables/#http://localhost:4322/zh-cn/start-here/environment-variables/#oauth-认证环境变量 [auth-config-ref]: /zh-cn/config-reference/dashboard/#authconfig [self-hosted-libsql]: /zh-cn/guides/database/sqld-server/ \ No newline at end of file From 48d9443b2767042eb25c0c46f7f4c22841326211 Mon Sep 17 00:00:00 2001 From: Jenxi Date: Thu, 3 Jul 2025 22:18:27 +0800 Subject: [PATCH 22/25] Update availTranslations.ts --- src/starlight-sidebar/availTranslations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/starlight-sidebar/availTranslations.ts b/src/starlight-sidebar/availTranslations.ts index 783c24ee..69aafc24 100644 --- a/src/starlight-sidebar/availTranslations.ts +++ b/src/starlight-sidebar/availTranslations.ts @@ -1 +1 @@ -export const Translations = ['en', 'es', 'fr', 'ko', 'de', 'zh-CN'] as const; +export const Translations = ['en', 'es', 'fr', 'ko', 'de', 'zh-cn'] as const; From 905a5344362e1e1512b2c31acfb2598b147fdd60 Mon Sep 17 00:00:00 2001 From: Jenxi Seow Date: Fri, 4 Jul 2025 16:24:55 +0800 Subject: [PATCH 23/25] Rename zh-CN.json to zh-cn.json --- src/starlight-sidebar/{zh-CN.json => zh-cn.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/starlight-sidebar/{zh-CN.json => zh-cn.json} (100%) diff --git a/src/starlight-sidebar/zh-CN.json b/src/starlight-sidebar/zh-cn.json similarity index 100% rename from src/starlight-sidebar/zh-CN.json rename to src/starlight-sidebar/zh-cn.json From 6d2800e8c1234c7c8dc641cd6f72699491af4513 Mon Sep 17 00:00:00 2001 From: Jenxi Date: Sat, 5 Jul 2025 16:52:27 +0800 Subject: [PATCH 24/25] Fixed invalid links --- src/content/docs/zh-cn/guides/index.mdx | 2 +- src/content/docs/zh-cn/start-here/environment-variables.mdx | 2 +- src/content/docs/zh-cn/start-here/getting-started.mdx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/content/docs/zh-cn/guides/index.mdx b/src/content/docs/zh-cn/guides/index.mdx index 128a1485..e408e27b 100644 --- a/src/content/docs/zh-cn/guides/index.mdx +++ b/src/content/docs/zh-cn/guides/index.mdx @@ -12,7 +12,7 @@ description: StudioCMS 使用教程和开发指南 ## 升级指南 -- [发布说明](/en/guides/upgrade/release-notes/) - 从 StudioCMS 更新日志自动生成的发布说明 +- [发布说明](/zh-cn/guides/upgrade/release-notes/) - 从 StudioCMS 更新日志自动生成的发布说明 - 更多版本特定指南请查看侧边栏导航 ## 数据库指南 diff --git a/src/content/docs/zh-cn/start-here/environment-variables.mdx b/src/content/docs/zh-cn/start-here/environment-variables.mdx index a3109f0e..cd7db15e 100644 --- a/src/content/docs/zh-cn/start-here/environment-variables.mdx +++ b/src/content/docs/zh-cn/start-here/environment-variables.mdx @@ -29,7 +29,7 @@ ASTRO_DB_APP_TOKEN=eyJh...RUCg 有关 `@astrojs/db` 的详细信息,请参阅 [Astro DB 文档](https://docs.astro.build/zh-CN/guides/astro-db/) -### `@studiocms/auth` 加密密钥 +### `@studiocms-auth` 加密密钥 `CMS_ENCRYPTION_KEY` - 用于加密敏感数据的安全密钥 diff --git a/src/content/docs/zh-cn/start-here/getting-started.mdx b/src/content/docs/zh-cn/start-here/getting-started.mdx index 94e0c384..65439d02 100644 --- a/src/content/docs/zh-cn/start-here/getting-started.mdx +++ b/src/content/docs/zh-cn/start-here/getting-started.mdx @@ -342,7 +342,7 @@ export default defineStudioCMSConfig({ [environment-variables]: /zh-cn/start-here/environment-variables/ [config-reference]: /zh-cn/config-reference/ [db-url-token]: /zh-cn/start-here/environment-variables/#astrojsdb-数据库连接参数 -[encryption-key]: /zh-cn/start-here/environment-variables/#http://localhost:4322/zh-cn/start-here/environment-variables/#studiocmsauth-加密密钥 -[oauth-environment-variables]: /zh-cn/start-here/environment-variables/#http://localhost:4322/zh-cn/start-here/environment-variables/#oauth-认证环境变量 +[encryption-key]: /zh-cn/start-here/environment-variables/#studiocmsauth-加密密钥 +[oauth-environment-variables]: /zh-cn/start-here/environment-variables/#oauth-认证环境变量 [auth-config-ref]: /zh-cn/config-reference/dashboard/#authconfig [self-hosted-libsql]: /zh-cn/guides/database/sqld-server/ \ No newline at end of file From 7da7bb451fe178a2cde7bc6e1d6dece7b47da8dd Mon Sep 17 00:00:00 2001 From: Jenxi Date: Sat, 5 Jul 2025 20:40:05 +0800 Subject: [PATCH 25/25] Update getting-started.mdx --- src/content/docs/zh-cn/start-here/getting-started.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/zh-cn/start-here/getting-started.mdx b/src/content/docs/zh-cn/start-here/getting-started.mdx index 65439d02..e4a1a890 100644 --- a/src/content/docs/zh-cn/start-here/getting-started.mdx +++ b/src/content/docs/zh-cn/start-here/getting-started.mdx @@ -342,7 +342,7 @@ export default defineStudioCMSConfig({ [environment-variables]: /zh-cn/start-here/environment-variables/ [config-reference]: /zh-cn/config-reference/ [db-url-token]: /zh-cn/start-here/environment-variables/#astrojsdb-数据库连接参数 -[encryption-key]: /zh-cn/start-here/environment-variables/#studiocmsauth-加密密钥 +[encryption-key]: /zh-cn/start-here/environment-variables/#studiocms-auth-加密密钥 [oauth-environment-variables]: /zh-cn/start-here/environment-variables/#oauth-认证环境变量 [auth-config-ref]: /zh-cn/config-reference/dashboard/#authconfig [self-hosted-libsql]: /zh-cn/guides/database/sqld-server/ \ No newline at end of file