Skip to content

Commit

Permalink
examples: convert navlist to use details elements
Browse files Browse the repository at this point in the history
  • Loading branch information
zackschuster committed Oct 4, 2022
1 parent d70c795 commit b030f0b
Show file tree
Hide file tree
Showing 3 changed files with 263 additions and 37 deletions.
4 changes: 2 additions & 2 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,13 @@ async function buildWebsite() {
header: mustache.render(headerTemplate, { examplesActive: true, version }),
nav: groups.reduce((html, group, i) => {
const groupNum = i + 1;
html += `<h4 id="groupHeader-${groupNum}">${group}</h4><ul id="groupContainer-${groupNum}" style="display:none">`;
html += `<details id="groupHeader-${groupNum}"><summary>${group}</summary><ul id="groupContainer-${groupNum}">`;

for (const example of examplesByGroup[group]) {
html += `<li id="exampleLink-${example.id}">${example.name}</id>`;
}

return (html += '</ul>');
return (html += '</ul></details>');
}, ''),
version
})),
Expand Down
Loading

0 comments on commit b030f0b

Please sign in to comment.