Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
oldme-git committed Oct 29, 2024
2 parents a545915 + ce9829c commit 7eac347
Show file tree
Hide file tree
Showing 31 changed files with 785 additions and 281 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/doc-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- 'main'
# schedule:
# - cron: '0 15 * * *'

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Install dependencies
run: npm ci
- name: Build website
run: npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
# cname: pages.goframe.org
File renamed without changes.
158 changes: 79 additions & 79 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const LATEST_VERSION_LABEL = "Latest";
const LATEST_VERSION_LABEL = 'Latest';

import type * as Preset from '@docusaurus/preset-classic';
import type { Config } from '@docusaurus/types';
Expand All @@ -8,7 +8,8 @@ import { themes as prismThemes } from 'prism-react-renderer';
// https://docusaurus.io/docs/3.2.1/api/docusaurus-config
const config: Config = {
title: 'GoFrame官网 - 类似PHP-Laravel, Java-SpringBoot的Go企业级开发框架',
tagline: 'GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang.',
tagline:
'GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang.',
favicon: '/img/favicon.ico',
url: 'https://goframe.org/',
baseUrl: '/',
Expand All @@ -26,18 +27,29 @@ const config: Config = {
[
'classic',
{
// Will be passed to @docusaurus/plugin-content-docs (false to disable)
docs: {
sidebarPath: './sidebars.ts',
lastVersion: "current",
sidebarPath: require.resolve('./sidebars.ts'),
lastVersion: 'current',
// https://docusaurus.io/docs/versioning
versions: {
current: {
label: LATEST_VERSION_LABEL,
},
current: {
label: LATEST_VERSION_LABEL,
},
},
// 编辑当前页面的配置
editUrl: 'https://github.com/gogf/gf-site/blob/main/',
// 显示更新时间和作者
showLastUpdateTime: true,
showLastUpdateAuthor: true,
},
// Will be passed to @docusaurus/plugin-content-blog (false to disable)
blog: {},
// Will be passed to @docusaurus/plugin-content-pages (false to disable)
pages: {},
// Will be passed to @docusaurus/theme-classic.
theme: {
customCss: './src/css/custom.css',
customCss: require.resolve('./src/css/custom.css'),
},
} satisfies Preset.Options,
],
Expand All @@ -52,26 +64,15 @@ const config: Config = {
language: 'zh',
},
],

// 快速开始
[
'@docusaurus/plugin-content-docs',
{
id: 'quick',
path: 'quick',
routeBasePath: 'quick',
sidebarPath: './sidebars.ts',
// ... other options
},
],
// 常见问题
[
'@docusaurus/plugin-content-docs',
{
id: 'faq',
path: 'faq',
routeBasePath: 'faq',
sidebarPath: './sidebars.ts',
sidebarPath: require.resolve('./sidebars.ts'),
// ... other options
},
],
Expand All @@ -82,19 +83,18 @@ const config: Config = {
id: 'release',
path: 'release',
routeBasePath: 'release',
sidebarPath: './sidebars.ts',
sidebarPath: require.resolve('./sidebars.ts'),
// ... other options
},
],
// 获得帮助
[
'@docusaurus/plugin-content-docs',
{
id: "help",
path: "help",
routeBasePath: "help",
sidebarPath: './sidebars.ts',

id: 'help',
path: 'help',
routeBasePath: 'help',
sidebarPath: require.resolve('./sidebars.ts'),
},
],
// 支持我们
Expand All @@ -104,7 +104,7 @@ const config: Config = {
id: 'supportus',
path: 'supportus',
routeBasePath: 'supportus',
sidebarPath: './sidebars.ts',
sidebarPath: require.resolve('./sidebars.ts'),
},
],
// 加入我们
Expand All @@ -114,107 +114,104 @@ const config: Config = {
id: 'joinus',
path: 'joinus',
routeBasePath: 'joinus',
sidebarPath: './sidebars.ts',
sidebarPath: require.resolve('./sidebars.ts'),
},
],
],
themeConfig: {
image: 'img/docusaurus-social-card.jpg',
colorMode: {
defaultMode: "light",
disableSwitch: true,
respectPrefersColorScheme: false,
},
navbar: {
title: 'GoFrame',
title: '',
logo: {
alt: 'GoFrame Logo',
src: 'img/favicon.ico',
src: '/img/logo2.png',
},
items: [
{
"type": "docSidebar",
"sidebarId": "tutorialSidebar",
"docsPluginId": "quick",
"position": "left",
"label": "快速开始"
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
docsPluginId: 'quick',
position: 'right',
label: '快速开始',
},
{
position: 'left',
position: 'right',
label: '开发手册',
items: [
{
label: '框架设计',
to: '/docs/框架设计'
to: '/docs/框架设计',
},
{
label: '开发工具',
to: '/docs/开发工具'
to: '/docs/开发工具',
},
{
label: '组件手册',
to: '/docs/核心组件'
to: '/docs/核心组件',
},
{
label: '微服务开发',
to: '/docs/微服务开发'
to: '/docs/微服务开发',
},
{
label: 'WEB服务开发',
to: '/docs/WEB服务开发'
to: '/docs/WEB服务开发',
},
{
label: '服务可观测性',
to: '/docs/服务可观测性'
to: '/docs/服务可观测性',
},
]
},
{
"type": "docSidebar",
"sidebarId": "tutorialSidebar",
"docsPluginId": "faq",
"position": "left",
"label": "常见问题"
],
},
{
"type": "docSidebar",
"sidebarId": "tutorialSidebar",
"docsPluginId": "release",
"position": "left",
"label": "发布记录"
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
docsPluginId: 'release',
position: 'right',
label: '发布记录',
},

{
"type": "docSidebar",
"sidebarId": "tutorialSidebar",
"docsPluginId": "help",
"position": "left",
"label": "获得帮助"
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
docsPluginId: 'help',
position: 'right',
label: '获得帮助',
},
{
"type": "docSidebar",
"sidebarId": "tutorialSidebar",
"docsPluginId": "supportus",
"position": "left",
"label": "支持我们"
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
docsPluginId: 'supportus',
position: 'right',
label: '支持我们',
},
{
"type": "docSidebar",
"sidebarId": "tutorialSidebar",
"docsPluginId": "joinus",
"position": "left",
"label": "加入我们"
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
docsPluginId: 'joinus',
position: 'right',
label: '加入我们',
},
{
type: "docsVersionDropdown",
position: "right",
type: 'docsVersionDropdown',
position: 'right',
dropdownActiveClassDisabled: true,
},
{
"href": 'https://github.com/gogf/gf/issues',
"position": "right",
"label": "问题反馈"
href: 'https://github.com/gogf/gf/issues',
position: 'right',
label: '问题反馈',
},
{
href: 'https://github.com/gogf/gf',
position: 'right',
className: 'header-github-link',
}
},
],
},
// toc目录层级显示设置
Expand All @@ -225,10 +222,13 @@ const config: Config = {
footer: {
copyright: `Copyright ©${new Date().getFullYear()} GoFrame OpenSource Team`,
},
// 代码块配置
prism: {
theme: prismThemes.oneDark,
theme: prismThemes.okaidia,
darkTheme: prismThemes.dracula,
defaultLanguage: 'go',
additionalLanguages: ['bash', 'javascript'], // 添加语言
// 默认支持的语言 https://github.com/FormidableLabs/prism-react-renderer/blob/master/packages/generate-prism-languages/index.ts#L9-L23
},
} satisfies Preset.ThemeConfig,
};
Expand Down
Loading

0 comments on commit 7eac347

Please sign in to comment.