Skip to content

Commit 470f49c

Browse files
authored
refactor: split doc and website (#1225)
1 parent 3b1c02e commit 470f49c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+12031
-2455
lines changed

.eslintignore

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/**/*/src/static/js/**/*.js
2-
/website/src/assets
3-
/website/src/fonts
4-
/website/src/shaders
2+
/**/*/src/assets
3+
/**/*/src/fonts
4+
/**/*/src/shaders
55
/**/*/.docusaurus
66
/website/articles
77
/blog/**/blog
88
/**/*/build
9-
/website/docs
10-
/website/docs-apisix*
11-
/website/i18n
9+
/**/*/docs
10+
/**/*/docs-apisix*
11+
/**/*/i18n
1212
yarn.lock

.eslintrc.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ module.exports = {
8282
'no-lonely-if': OFF,
8383
'no-lone-blocks': OFF,
8484
'react/jsx-filename-extension': [ERROR, { extensions: ['.jsx', '.tsx'] }],
85-
'import/extensions': [ERROR, { tsx: 'never', svg: 'always' }],
85+
'import/extensions': [
86+
ERROR,
87+
{ tsx: 'never', svg: 'always', json: 'never' },
88+
],
8689
'react/jsx-props-no-spreading': OFF,
8790
'react/function-component-definition': [
8891
ERROR,
@@ -97,10 +100,10 @@ module.exports = {
97100
files: [
98101
'scripts/**/*.js',
99102
'website/src/clientModules/**/*.js',
100-
'website/config/**/*.js',
101-
'website/babel.config.js',
102-
'website/**/docusaurus.config.*',
103-
'blog/**/docusaurus.config.*',
103+
'config/**/*.js',
104+
'**/*/babel.config.js',
105+
'**/*/docusaurus.config.*',
106+
'website/docusaurus.config.js',
104107
],
105108
env: {
106109
node: true,

.github/workflows/deploy.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929

3030
- uses: actions/setup-node@v3
3131
with:
32-
node-version: "14"
32+
node-version: "16"
3333

3434
- name: Get node version
3535
id: node-version
@@ -87,6 +87,9 @@ jobs:
8787
./website/.docusaurus
8888
./website/build
8989
./website/node_modules
90+
./doc/.docusaurus
91+
./doc/build
92+
./doc/node_modules
9093
./blog/node_modules
9194
./blog/en/.docusaurus
9295
./blog/en/build

.github/workflows/link-check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- uses: actions/[email protected]
2727
- uses: actions/setup-node@v3
2828
with:
29-
node-version: "14"
29+
node-version: "16"
3030

3131
- name: Install Dependencies
3232
run: |

.gitignore

+5-23
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,10 @@ scripts/yarn.lock
4040
/.eslintcache
4141
/.stylelintcache
4242

43-
website/docs/*
44-
!website/docs/general
45-
website/docs-apisix_versioned_docs/*
46-
website/docs-apisix_versioned_sidebars/*
47-
website/docs-apisix-dashboard_versioned_docs/*
48-
website/docs-apisix-dashboard_versioned_sidebars/*
49-
website/docs-apisix-docker_versioned_docs/*
50-
website/docs-apisix-docker_versioned_sidebars/*
51-
website/docs-apisix-go-plugin-runner_versioned_docs/*
52-
website/docs-apisix-go-plugin-runner_versioned_sidebars/*
53-
website/docs-apisix-java-plugin-runner_versioned_docs/*
54-
website/docs-apisix-java-plugin-runner_versioned_sidebars/*
55-
website/docs-apisix-python-plugin-runner_versioned_docs/*
56-
website/docs-apisix-python-plugin-runner_versioned_sidebars/*
43+
/doc/docs/*
44+
/doc/docs-apisix*/**
45+
/doc/docs-apisix*.json
5746

58-
website/docs-apisix_versions.json
59-
website/docs-apisix-dashboard_versions.json
60-
website/docs-apisix-docker_versions.json
61-
website/docs-apisix-go-plugin-runner_versions.json
62-
website/docs-apisix-java-plugin-runner_versions.json
63-
website/docs-apisix-python-plugin-runner_versions.json
64-
65-
website/i18n/zh/docusaurus-plugin-content-docs-docs-apisix/**
47+
/doc/i18n/zh/docusaurus-plugin-content-docs-docs-*/**
6648
scripts/temp/**
67-
website/config/repos-info.json
49+
/config/repos-info.json

blog/en/docusaurus.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { ssrTemplate } = require('../../website/config/ssrTemplate');
1+
const { ssrTemplate } = require('../../config/ssrTemplate');
22

33
module.exports = {
44
title: 'Apache APISIX® -- Cloud-Native API Gateway',
@@ -52,7 +52,7 @@ module.exports = {
5252
logo: {
5353
src: 'img/logo2.svg',
5454
},
55-
items: require('../../website/config/navbar.js'),
55+
items: require('../../config/navbar.js'),
5656
},
5757
hideableSidebar: true,
5858
announcementBar: {

blog/src/theme/BlogPostPage/index.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@ import type { ImageProps } from 'rc-image';
1818
import Image from 'rc-image';
1919
// eslint-disable-next-line import/no-extraneous-dependencies
2020
import { MDXProvider } from '@mdx-js/react';
21+
import { LazyLoadComponent } from 'react-lazy-load-image-component';
2122

2223
const components = {
2324
...MDXComponents,
24-
img: (props: ImageProps) => <Image {...props} preview={{ mask: 'Click to Preview' }} />,
25+
img: (props: ImageProps) => (
26+
<LazyLoadComponent>
27+
<Image {...props} preview={{ mask: 'Click to Preview' }} />
28+
</LazyLoadComponent>
29+
),
2530
};
2631

2732
const BlogPostPage = (props: Props): JSX.Element => {

blog/static/robots.txt

-5
This file was deleted.

blog/zh/docusaurus.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { ssrTemplate } = require('../../website/config/ssrTemplate');
1+
const { ssrTemplate } = require('../../config/ssrTemplate');
22

33
module.exports = {
44
title: 'Apache APISIX® -- Cloud-Native API Gateway',
@@ -52,7 +52,7 @@ module.exports = {
5252
logo: {
5353
src: 'img/logo2.svg',
5454
},
55-
items: require('../../website/config/navbar.js'),
55+
items: require('../../config/navbar.js'),
5656
},
5757
hideableSidebar: true,
5858
announcementBar: {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)