Commit 6aa3e802 authored by liziwl's avatar liziwl
Browse files

更新手册配置

parent c2ba6b47
Loading
Loading
Loading
Loading
+99 −68
Original line number Diff line number Diff line
@@ -3,7 +3,17 @@ let title = '南科手册'
let description = 'Online manual for sustecher'
let color = '#49BF7C'
let author = 'sustech.online'
// const {path} = require('@vuepress/utils')
const { defaultTheme } = require('vuepress')
const { docsearchPlugin } = require('@vuepress/plugin-docsearch')
const { googleAnalyticsPlugin } = require('@vuepress/plugin-google-analytics')
const { pwaPlugin } = require('@vuepress/plugin-pwa')
const { pwaPopupPlugin } = require('@vuepress/plugin-pwa-popup')
const { mediumZoomPlugin } = require('@vuepress/plugin-medium-zoom')
const { nprogressPlugin } = require('@vuepress/plugin-nprogress')
const { backToTopPlugin } = require('@vuepress/plugin-back-to-top')
const { gitPlugin } = require('@vuepress/plugin-git')
const { tocPlugin } = require('@vuepress/plugin-toc')


module.exports = {
    locales: {
@@ -82,55 +92,77 @@ module.exports = {
        //         },
        //     },
        // ],
        [
            '@vuepress/plugin-docsearch',
            {
        docsearchPlugin({
            appId: '6KECEJUGJH',
            apiKey: '9a5c8aa7cb2d5d32ebd66790e1a84789',
            indexName: 'sustech-online-keys',
            locales: {
                '/': {
                    placeholder: '搜索手册',
                    translations: {
                        button: {
                            buttonText: '搜索手册',
                            buttonAriaLabel: '搜索手册',
                        },
                        modal: {
                            searchBox: {
                                resetButtonTitle: '清除查询条件',
                                resetButtonAriaLabel: '清除查询条件',
                                cancelButtonText: '取消',
                                cancelButtonAriaLabel: '取消',
                            },
                            startScreen: {
                                recentSearchesTitle: '搜索历史',
                                noRecentSearchesText: '没有搜索历史',
                                saveRecentSearchButtonTitle: '保存至搜索历史',
                                removeRecentSearchButtonTitle: '从搜索历史中移除',
                                favoriteSearchesTitle: '收藏',
                                removeFavoriteSearchButtonTitle: '从收藏中移除',
                            },
        ],
        [
            '@vuepress/plugin-google-analytics',
            {
                id: 'G-1BQBXDGY3R',
                            errorScreen: {
                                titleText: '无法获取结果',
                                helpText: '你可能需要检查你的网络连接',
                            },
        ],
        '@vuepress/medium-zoom',
        [
            '@vuepress/plugin-pwa',
            {
                            footer: {
                                selectText: '选择',
                                navigateText: '切换',
                                closeText: '关闭',
                                searchByText: '搜索提供者',
                            },
                            noResultsScreen: {
                                noResultsText: '无法找到相关结果',
                                suggestedQueryText: '你可以尝试查询',
                                reportMissingResultsText: '你认为该查询应该有结果?',
                                reportMissingResultsLinkText: '点击反馈',
                            },
                        },
                    },
                },
            },
        }),
        googleAnalyticsPlugin({
            // we have multiple deployments, which would use different id
            id: 'G-1BQBXDGY3R',
        }),
        pwaPlugin({
            maximumFileSizeToCacheInBytes: 524288, // 限制到0.5MB
            skipWaiting: true
            },
            {
                generateSWConfig: {
                    importWorkboxFrom: 'local'
                }
            }
        ],
        [
            '@vuepress/plugin-pwa-popup',
            {
        }),
        pwaPopupPlugin({
            locales: {
                '/': {
                    message: '发现新内容可用',
                    buttonText: '刷新',
                },
            },
            },
        ],
        '@vuepress/plugin-nprogress',
        '@vuepress/back-to-top',
        '@vuepress/plugin-git',
        '@vuepress/plugin-toc',
        }),
        mediumZoomPlugin(),
        nprogressPlugin(),
        backToTopPlugin(),
        gitPlugin(),
        tocPlugin(),
    ],
    themeConfig: {
    theme: defaultTheme({
        navbar: [
            { text: '主页', link: '/' },
            { text: '快讯网', link: 'https://daily.sustech.online/' },
@@ -139,15 +171,14 @@ module.exports = {
            { text: '站点帮助', link: '/site-help/' },
        ],
        repo: 'sustech-cra/sustech-online-ng',
        repoLabel: '在Github上查看',
        docsRepo: 'sustech-cra/sustech-online-ng',
        docsDir: 'docs',
        repoLabel: '在Github上查看',
        editLinkText: '一起完善这本手册!',
        lastUpdatedText: '上次更新',
        contributorsText: '贡献者',
        editLinks: true,
        docsBranch: 'master',
        smoothScroll: true,
        sidebarDepth: 2,
        sidebar: [
            '/',
@@ -188,5 +219,5 @@ module.exports = {
            },
            '/surroundings/',
        ]
    }
    }),
}
+10 −10