mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Website: Update generated subtopics in Markdown content (#10724)
https://fleetdm.slack.com/archives/C01EZVBHFHU/p1679598174642469 Changes: - Updated the handbook and documentation pages page script to strip `'` characters from subtopic IDs before they're converted to kebab case.
This commit is contained in:
parent
ee116d14ca
commit
b6fa586904
2 changed files with 2 additions and 2 deletions
|
|
@ -120,7 +120,7 @@ parasails.registerPage('basic-documentation', {
|
|||
let subtopics = $('#body-content').find('h2.markdown-heading').map((_, el) => el.innerText);
|
||||
subtopics = $.makeArray(subtopics).map((title) => {
|
||||
// Removing all apostrophes from the title to keep _.kebabCase() from turning words like 'user’s' into 'user-s'
|
||||
let kebabCaseFriendlyTitle = title.replace(/[\’]/g, '');
|
||||
let kebabCaseFriendlyTitle = title.replace(/[\’\']/g, '');
|
||||
return {
|
||||
title,
|
||||
url: '#' + _.kebabCase(kebabCaseFriendlyTitle.toLowerCase()),
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ parasails.registerPage('basic-handbook', {
|
|||
}
|
||||
subtopics = $.makeArray(subtopics).map((title) => {
|
||||
// Removing all apostrophes from the title to keep _.kebabCase() from turning words like 'user’s' into 'user-s'
|
||||
let kebabCaseFriendlyTitle = title.replace(/[\’]/g, '');
|
||||
let kebabCaseFriendlyTitle = title.replace(/[\’\']/g, '');
|
||||
return {
|
||||
title: title.replace(/([\uE000-\uF8FF]|\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF])/g, ''), // take out any emojis (they look weird in the menu)
|
||||
url: '#' + _.kebabCase(kebabCaseFriendlyTitle.toLowerCase()),
|
||||
|
|
|
|||
Loading…
Reference in a new issue