1
- const path = require ( 'path' )
1
+ // @ts -check
2
+ // Note: type annotations allow type checking and IDEs autocompletion
2
3
3
- const remarkImages = require ( 'remark-images ' )
4
- const rehypeTruncate = require ( 'rehype-truncate ' )
4
+ const lightCodeTheme = require ( 'prism-react-renderer/themes/github ' )
5
+ const darkCodeTheme = require ( 'prism-react-renderer/themes/dracula ' )
5
6
6
- const PACKAGE = require ( '../package' )
7
+ const PACKAGE = require ( '../package.json ' )
7
8
const GITHUB_URL = 'https://github.com/htmlhint/HTMLHint'
8
9
9
- module . exports = {
10
+ /** @type {import('@docusaurus/types').Config } */
11
+ const config = {
10
12
title : 'HTMLHint' ,
11
13
tagline : 'Static code analysis tool you need for your HTML' ,
12
14
url : PACKAGE . homepage ,
13
15
baseUrl : '/' ,
16
+ onBrokenLinks : 'throw' ,
17
+ onBrokenMarkdownLinks : 'warn' ,
14
18
favicon : 'img/favicon.ico' ,
15
19
organizationName : 'HTMLHint' ,
16
20
projectName : PACKAGE . name ,
17
21
scripts : [ 'https://buttons.github.io/buttons.js' ] ,
18
- themeConfig : {
19
- googleAnalytics : { trackingID : 'UA-109578378-3' } ,
20
- hotjar : { hjid : 1812834 } ,
21
- navbar : {
22
- title : 'HTMLHint' ,
23
- logo : {
24
- alt : 'HTMLHint Logo' ,
25
- src : 'img/htmlhint.png' ,
26
- } ,
27
- links : [
28
- {
29
- label : 'Docs' ,
30
- to : '/docs/user-guide/getting-started' ,
31
- position : 'left' ,
32
- } ,
33
- {
34
- label : 'Playground' ,
35
- href : 'https://htmlhint-playground.netlify.app' ,
36
- position : 'left' ,
37
- } ,
38
- {
39
- href : 'https://github.com/HTMLHint/HTMLHint' ,
40
- label : 'GitHub' ,
41
- position : 'left' ,
42
- } ,
43
- ] ,
44
- } ,
45
- footer : {
46
- style : 'dark' ,
47
- links : [
48
- {
49
- title : 'Community' ,
50
- items : [
51
- {
52
- label : 'Stack Overflow' ,
53
- href : 'https://stackoverflow.com/questions/tagged/htmlhint' ,
54
- } ,
55
- {
56
- label : 'Discord' ,
57
- href : 'https://discord.com/invite/nJ6J9CP' ,
58
- } ,
59
- {
60
- label : 'Twitter' ,
61
- href : 'https://twitter.com/HTMLHint' ,
62
- } ,
63
- ] ,
64
- } ,
65
- {
66
- title : 'More' ,
67
- items : [
68
- {
69
- label : 'HTMLHint organization' ,
70
- href : 'https://github.com/HTMLHint' ,
71
- } ,
72
- ] ,
73
- } ,
74
- ] ,
75
- copyright : `${ new Date ( ) . getFullYear ( ) } HTMLHint. Built with Docusaurus.` ,
76
- } ,
77
- } ,
78
- plugins : [
79
- path . resolve ( __dirname , './plugins/docusaurus-plugin-hotjar' ) ,
80
- [
81
- '@docusaurus/plugin-sitemap' ,
82
- {
83
- cacheTime : 600 * 1000 ,
84
- } ,
85
- ] ,
86
- ] ,
87
22
presets : [
88
23
[
89
24
'@docusaurus/preset-classic' ,
90
- {
25
+ /** @type {import('@docusaurus/preset-classic').Options } */
26
+ ( {
91
27
docs : {
92
28
path : '../docs' ,
93
29
sidebarPath : require . resolve ( './sidebars.js' ) ,
@@ -98,9 +34,85 @@ module.exports = {
98
34
theme : {
99
35
customCss : require . resolve ( './src/css/custom.css' ) ,
100
36
} ,
101
- remarkPlugins : [ remarkImages ] ,
102
- rehypePlugins : [ rehypeTruncate ] ,
37
+ } ) ,
38
+ ] ,
39
+ ] ,
40
+ plugins : [
41
+ '@docusaurus/plugin-google-analytics' ,
42
+ [
43
+ '@docusaurus/plugin-sitemap' ,
44
+ {
45
+ changefreq : 'weekly' ,
46
+ priority : 0.5 ,
103
47
} ,
104
48
] ,
105
49
] ,
50
+ themeConfig :
51
+ /** @type {import('@docusaurus/preset-classic').ThemeConfig } */
52
+ ( {
53
+ googleAnalytics : { trackingID : 'UA-109578378-3' } ,
54
+ navbar : {
55
+ title : 'HTMLHint' ,
56
+ logo : {
57
+ alt : 'HTMLHint Logo' ,
58
+ src : 'img/htmlhint.png' ,
59
+ } ,
60
+ items : [
61
+ {
62
+ type : 'doc' ,
63
+ docId : 'user-guide/getting-started' ,
64
+ position : 'left' ,
65
+ label : 'Docs' ,
66
+ } ,
67
+ {
68
+ label : 'Playground' ,
69
+ href : 'https://htmlhint-playground.netlify.app' ,
70
+ position : 'left' ,
71
+ } ,
72
+ {
73
+ href : 'https://github.com/HTMLHint/HTMLHint' ,
74
+ label : 'GitHub' ,
75
+ position : 'left' ,
76
+ } ,
77
+ ] ,
78
+ } ,
79
+ footer : {
80
+ style : 'dark' ,
81
+ links : [
82
+ {
83
+ title : 'Community' ,
84
+ items : [
85
+ {
86
+ label : 'Stack Overflow' ,
87
+ href : 'https://stackoverflow.com/questions/tagged/htmlhint' ,
88
+ } ,
89
+ {
90
+ label : 'Discord' ,
91
+ href : 'https://discord.com/invite/nJ6J9CP' ,
92
+ } ,
93
+ {
94
+ label : 'Twitter' ,
95
+ href : 'https://twitter.com/HTMLHint' ,
96
+ } ,
97
+ ] ,
98
+ } ,
99
+ {
100
+ title : 'More' ,
101
+ items : [
102
+ {
103
+ label : 'HTMLHint organization' ,
104
+ href : 'https://github.com/HTMLHint' ,
105
+ } ,
106
+ ] ,
107
+ } ,
108
+ ] ,
109
+ copyright : `${ new Date ( ) . getFullYear ( ) } HTMLHint. Built with Docusaurus.` ,
110
+ } ,
111
+ prism : {
112
+ theme : lightCodeTheme ,
113
+ darkTheme : darkCodeTheme ,
114
+ } ,
115
+ } ) ,
106
116
}
117
+
118
+ module . exports = config
0 commit comments