Skip to content

Commit

Permalink
Fix: Generating unnecessary new ids for sidebar items
Browse files Browse the repository at this point in the history
For no reason we are creating new ids for sidebar elements. This PR
fixes it by using `sidebar-` + `elementHeading` as its id

fixes: #254
  • Loading branch information
ankitskvmdam committed Nov 7, 2023
1 parent 04cda99 commit 6474275
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const logger = require('jsdoc/util/logger');
const path = require('jsdoc/path');
const { taffy } = require('@jsdoc/salty');
const template = require('jsdoc/template');
const nanoid = require('nanoid').nanoid;
const htmlMinify = require('html-minifier-terser');

const {
Expand Down Expand Up @@ -429,7 +428,7 @@ function buildSidebarMembers({
const navProps = {
name: itemHeading,
items: [],
id: nanoid(),
id: `sidebar-${itemHeading.toLowerCase()}`,
};

if (items.length) {
Expand Down

0 comments on commit 6474275

Please sign in to comment.