Skip to content

Commit 19402f4

Browse files
authored
docs: update docusaurus (#774)
1 parent 3ca4715 commit 19402f4

File tree

7 files changed

+12581
-18855
lines changed

7 files changed

+12581
-18855
lines changed

website/.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

website/.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry='https://registry.npmjs.org/'

website/babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
}

website/docusaurus.config.js

+89-77
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,29 @@
1-
const path = require('path')
1+
// @ts-check
2+
// Note: type annotations allow type checking and IDEs autocompletion
23

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')
56

6-
const PACKAGE = require('../package')
7+
const PACKAGE = require('../package.json')
78
const GITHUB_URL = 'https://github.com/htmlhint/HTMLHint'
89

9-
module.exports = {
10+
/** @type {import('@docusaurus/types').Config} */
11+
const config = {
1012
title: 'HTMLHint',
1113
tagline: 'Static code analysis tool you need for your HTML',
1214
url: PACKAGE.homepage,
1315
baseUrl: '/',
16+
onBrokenLinks: 'throw',
17+
onBrokenMarkdownLinks: 'warn',
1418
favicon: 'img/favicon.ico',
1519
organizationName: 'HTMLHint',
1620
projectName: PACKAGE.name,
1721
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-
],
8722
presets: [
8823
[
8924
'@docusaurus/preset-classic',
90-
{
25+
/** @type {import('@docusaurus/preset-classic').Options} */
26+
({
9127
docs: {
9228
path: '../docs',
9329
sidebarPath: require.resolve('./sidebars.js'),
@@ -98,9 +34,85 @@ module.exports = {
9834
theme: {
9935
customCss: require.resolve('./src/css/custom.css'),
10036
},
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,
10347
},
10448
],
10549
],
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+
}),
106116
}
117+
118+
module.exports = config

0 commit comments

Comments
 (0)