Skip to content

Commit

Permalink
docsify: add version namespace to sidebar links
Browse files Browse the repository at this point in the history
  • Loading branch information
wellmann committed Apr 1, 2024
1 parent 385f5e4 commit d1951be
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css">
</head>
<body aria-busy="true">
<body>
<nav class="app-nav">
<ul>
<li>
Expand All @@ -34,11 +34,6 @@
loadSidebar: true,
mergeNavbar: true,
plugins: [
function a11y(hook) {
hook.init(function () {
document.body.setAttribute('aria-busy', 'false');
});
},
function pageTitle(hook) {
hook.doneEach(function () {
document.title = document.title + ' | ' + window.$docsify.name;
Expand Down Expand Up @@ -106,6 +101,15 @@
}
);
});

window.$docsify.namespaces = [
{
id: 'version',
values: tags.map((tag) => tag.name),
default: tags.filter((tag, index) => index === 0),
optional: true
}
];
}
function renderVersionSubMenu(tags) {
var versionSubMenu = document.getElementById('version-sub-menu');
Expand All @@ -121,6 +125,7 @@
}
</script>
<script src="https://cdn.jsdelivr.net/npm/docsify@4"></script>
<script src="https://unpkg.com/docsify-namespaced"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/components/prism-php.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/components/prism-json.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify/lib/plugins/search.min.js"></script>
Expand Down

0 comments on commit d1951be

Please sign in to comment.