Website: Update handbook page script to not create a link to handbook/company/handbook page in handbook index. (#14755)

FYI @Sampfluger88 

Changes:
- Updated the handbook page script to:
   - Add comments explaining what links are added to the handbook index.
   - Exclude the handbook/company/handbook page from the handbook index.
This commit is contained in:
Eric 2023-10-26 13:29:04 -05:00 committed by GitHub
parent 06aec6401f
commit a5fff556c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,7 +64,11 @@ parasails.registerPage('basic-handbook', {
if(this.isHandbookLandingPage) {
let handbookPages = [];
for (let page of this.markdownPages) {
if(_.startsWith(page.url, '/handbook/company') && !page.title.match(/^readme\.md$/i) && !_.startsWith(page.url, '/handbook/company/open-positions')) {
if(
_.startsWith(page.url, '/handbook/company')// Only add links for pages in the handbook/company/ folder
&& page.url !== '/handbook/company/handbook'// Hide the /handbook/company/handbook page in the handbook index.
&& !_.startsWith(page.url, '/handbook/company/open-positions')// Don't create links to pages generated for open positions.
) {
let pageTitle = page.title;
if(this.hideEmojisOnPage){
pageTitle = pageTitle.replace(this.regexToMatchEmoji, '');