1- const anchorPlugin = require ( 'markdown-it-anchor' )
21const { viteBundler } = require ( '@vuepress/bundler-vite' ) ;
3- const { shikiPlugin } = require ( '@vuepress/plugin-shiki' )
4- const { sitemapPlugin } = require ( 'vuepress-plugin-sitemap2' )
52
63const defaultTheme = require ( './theme' )
7- const { path } = require ( '@vuepress/utils' )
8- const { version } = require ( '../../package.json' )
94
10- // eslint-disable-next-line no-control-regex
11- const rControl = / [ \u0000 - \u001f ] / g
12- const rSpecial = / [ \s ~ ` ! @ # $ % ^ & * ( ) \- _ + = [ \] { } | \\ ; : " ' “ ” ‘ ’ < > , . ? / ] + / g
13- const rCombining = / [ \u0300 - \u036F ] / g
14-
15- const slugify = ( str ) => {
16- return str
17- . normalize ( 'NFKD' )
18- // Remove accents
19- . replace ( rCombining , '' )
20- // Remove control characters
21- . replace ( rControl , '' )
22- // Replace special characters
23- . replace ( rSpecial , '-' )
24- // Remove continuos separators
25- . replace ( / - { 2 , } / g, '-' )
26- // Remove prefixing and trailing separators
27- . replace ( / ^ - + | - + $ / g, '' )
28- // ensure it doesn't start with a number (#121)
29- . replace ( / ^ ( \d ) / , '_$1' )
30- // lowercase
31- . toLowerCase ( )
32- }
5+ const clientAppEnhanceFiles = require ( './configs/client-app-enhance-files' )
6+ const head = require ( './configs/head' )
7+ const extendsMarkdown = require ( './configs/extends-markdown' )
8+ const markdown = require ( './configs/markdown' )
9+ const navbar = require ( './configs/navbar' )
10+ const sidebar = require ( './configs/sidebar' )
11+ const plugins = require ( './configs/plugins' )
3312
3413module . exports = {
35- // site config
3614 lang : 'en-US' ,
3715 title : 'discue' ,
3816 description : 'Developer documentation for the secure and reliable messaging and queueing service.' ,
@@ -48,80 +26,13 @@ module.exports = {
4826 repo : 'discue/discue-io-docs' ,
4927 repoLabel : 'GitHub' ,
5028 sidebarDepth : 4 ,
51- navbar : [ {
52- text : 'Getting Started' ,
53- link : '/getting-started/' ,
54- } , {
55- text : 'API Overview' ,
56- link : '/api-overview/' ,
57- } , {
58- text : 'API Reference' ,
59- link : '/api-reference/' ,
60- {
61- text : `v${ version } ` ,
62- children : [
63- {
64- text : 'Changelog' ,
65- link : 'https://github.com/discue/ui-components/blob/main/CHANGELOG.md' ,
66- } ,
67- ] ,
68- } ] ,
69- sidebar : [ {
70- text : 'Introduction' ,
71- link : '/introduction/' ,
72- } , {
73- text : 'Getting Started' ,
74- link : '/getting-started/' ,
75- } , {
76- text : 'API Overview' ,
77- link : '/api-overview/' ,
78- } , {
79- text : 'API Best Practices' ,
80- link : '/api-best-practices/' ,
81- } , {
82- text : 'API Reference' ,
83- link : '/api-reference/' ,
84- } ] ,
29+ navbar,
30+ sidebar
8531 } ,
8632 ) ,
87- plugins : [
88- [ "@vuepress/plugin-prismjs" , false ] ,
89- sitemapPlugin ( {
90- hostname : 'https://docs.discue.io' ,
91- excludeUrls : [
92- 'https://docs.discue.io/api-reference/'
93- ]
94- } ) ,
95- shikiPlugin ( { theme : 'dark-plus' } )
96- ] ,
97- clientAppEnhanceFiles : path . resolve (
98- __dirname ,
99- './enhance/clientAppEnhance.js'
100- ) ,
101- extendsMarkdown : ( md ) => {
102- md . use ( require ( 'markdown-it-attrs' ) , {
103- allowedAttributes : [ 'id' ] ,
104- leftDelimiter : '[' ,
105- rightDelimiter : ']' ,
106- } )
107- md . use ( anchorPlugin , {
108- level : [ 1 , 2 , 3 , 4 , 5 , 6 ] ,
109- slugify,
110- permalink : anchorPlugin . permalink . ariaHidden ( {
111- class : 'header-anchor' ,
112- symbol : '#' ,
113- space : true ,
114- placement : 'before' ,
115- } ) ,
116- } )
117- } ,
118- markdown : {
119- extractHeaders : { level : [ 2 , 3 , 4 , 5 , 6 ] } ,
120- anchor : false
121- } ,
122- head : [
123- [ 'link' , { rel : 'icon' , type : "image/png" , sizes : "16x16" , href : "/icons-fire-all-black/web/favicon.ico" } ] ,
124- [ 'link' , { rel : 'icon' , type : "image/png" , sizes : "32x32" , href : "/icons-fire-all-black/web/favicon.ico" } ] ,
125- [ 'link' , { rel : "apple-touch-icon" , sizes : "152x152" , href : "/icons-fire-all-black/web/apple-touch-icon-152x152.png" } ]
126- ] ,
33+ plugins,
34+ clientAppEnhanceFiles,
35+ extendsMarkdown,
36+ markdown,
37+ head,
12738}
0 commit comments