axios-miniprogram/docs/.vitepress/config.ts

190 lines
4.7 KiB
TypeScript
Raw Normal View History

2023-03-24 22:35:58 +08:00
import { defineConfig } from 'vitepress';
2023-04-11 22:09:29 +08:00
import { VitePWA } from 'vite-plugin-pwa';
2023-04-12 17:36:05 +08:00
import { createIntroMD } from './utils/createIntroMD';
createIntroMD();
2023-03-24 22:35:58 +08:00
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'axios-miniprogram',
2023-04-12 17:36:05 +08:00
titleTemplate: ':title - axios',
2023-03-24 22:35:58 +08:00
description: '基于 Promise 的 HTTP 请求库,适用于各大小程序平台。',
2023-04-11 16:10:23 +08:00
srcDir: 'pages',
2023-04-13 14:16:11 +08:00
2023-04-12 17:36:05 +08:00
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [
2023-04-14 16:38:25 +08:00
{ text: '指南', link: '/intro' },
{ text: '基础', link: '/basics/options' },
2023-04-12 17:36:05 +08:00
],
sidebar: [
{
text: '指南',
items: [
2023-04-14 16:38:25 +08:00
{ text: '简介', link: '/intro' },
{ text: '开始', link: '/start' },
],
},
{
text: '基础',
items: [
{ text: 'OPTIONS 请求', link: '/basics/options' },
{ text: 'GET 请求', link: '/basics/get' },
{ text: 'HEAD 请求', link: '/basics/head' },
{ text: 'POST 请求', link: '/basics/post' },
{ text: 'PUT 请求', link: '/basics/put' },
2023-04-14 18:16:39 +08:00
{ text: 'PATCH 请求', link: '/basics/patch' },
2023-04-14 16:38:25 +08:00
{ text: 'DELETE 请求', link: '/basics/delete' },
{ text: 'TRACE 请求', link: '/basics/trace' },
{ text: 'CONNECT 请求', link: '/basics/connect' },
2023-04-12 17:36:05 +08:00
],
},
2023-04-14 16:38:25 +08:00
2023-04-12 17:36:05 +08:00
{
text: '配置',
items: [
{
text: '默认配置',
link: '/config/preview',
},
{
text: 'method',
link: '/config/method',
},
{
text: 'dataType',
link: '/config/data-type',
},
{
text: 'responseType',
link: '/config/response-type',
},
{
text: 'validateStatus',
link: '/config/validate-status',
},
{
text: 'paramsSerializer',
link: '/config/params-serializer',
},
{
text: 'transformRequest',
link: '/config/transform-request',
},
{
text: 'transformResponse',
link: '/config/transform-response',
},
{
text: 'errorHandler',
link: '/config/error-handler',
},
{
text: 'upload',
link: '/config/upload',
},
{
text: 'download',
link: '/config/download',
},
{
text: 'adapter',
link: '/config/adapter',
},
],
},
{
text: 'API',
items: [
{
text: 'interceptors',
link: '/api/interceptors',
},
{
text: 'CancelToken',
link: '/api/cancel-token',
},
{
text: 'isCancel',
link: '/api/is-cancel',
},
{
text: 'isAxiosError',
link: '/api/is-axios-error',
},
{
text: 'getUri',
link: '/api/get-uri',
},
{
text: 'create',
link: '/api/create',
},
{
text: 'fork <Badge type="warning" text="2.1.0" />',
link: '/api/fork',
},
{
text: 'Axios',
link: '/api/axios',
},
],
},
2023-04-12 21:21:03 +08:00
{
text: '致贡献者',
items: [
{
text: '行为准则',
link: 'https://github.com/zjx0905/axios-miniprogram/blob/main/CODE_OF_CONDUCT.md',
},
{
text: '贡献指南',
link: 'https://github.com/zjx0905/axios-miniprogram/blob/main/CONTRIBUTING.md',
},
],
},
2023-04-12 17:36:05 +08:00
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/zjx0905/axios-miniprogram' },
],
returnToTopLabel: '返回顶部',
outlineTitle: '导航栏',
darkModeSwitchLabel: '主题',
2023-04-13 14:16:11 +08:00
sidebarMenuLabel: '菜单',
docFooter: {
prev: '上一页',
next: '下一页',
},
2023-04-12 17:36:05 +08:00
footer: {
message:
'根据 <a href="https://github.com/zjx0905/axios-miniprogram/blob/main/LICENSE">MIT License</a> 发布',
copyright:
'Copyright © 2020-至今 <a href="https://github.com/zjx0905">zjx0905</a>',
},
},
2023-04-13 14:16:11 +08:00
markdown: {
theme: {
light: 'github-light',
dark: 'github-dark',
},
},
2023-04-11 22:09:29 +08:00
vite: {
plugins: [
VitePWA({
outDir: '.vitepress/dist',
manifest: {
name: 'axios-miniprogram',
short_name: 'axios',
theme_color: '#ffffff',
icons: [],
},
}),
2023-03-24 22:35:58 +08:00
],
},
});