Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: fixes links with badges in the tables of content #3438

Merged
merged 1 commit into from Jul 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/.vuepress/config.js
@@ -1,3 +1,11 @@
const { slugify } = require('@vuepress/shared-utils');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's in dependencies of vuepress, no need to import it explicitly


// TODO: remove once https://github.com/vuejs/vuepress/issues/1985 will be fixed
function slugifyWithBadges(str) {
// remove badges and use original slugify function
return slugify(str.replace(/<Badge[^>]*\/>/, ''));
}

module.exports = {
title: 'XState Docs',
base: '/docs/',
Expand All @@ -20,7 +28,7 @@ module.exports = {
}
},
markdown: {
toc: { includeLevel: [2, 3] }
toc: { includeLevel: [2, 3], slugify: slugifyWithBadges }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

includeLevel is by default [2, 3] in vuepress, this can be removed

},
head: [
['script', { src: 'https://plausible.io/js/plausible.js', defer: 'defer' }]
Expand Down