mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-23 02:08:30 +00:00
don’t generate sidebar links for non-docs pages
This commit is contained in:
parent
055b233e54
commit
e207ddb26b
1 changed files with 7 additions and 3 deletions
|
|
@ -116,8 +116,11 @@
|
|||
function initSubHeaders () {
|
||||
// build sidebar
|
||||
var currentPageAnchor = menu.querySelector('.sidebar-link.current')
|
||||
var isAPI = document.querySelector('.Content').classList.contains('api')
|
||||
if (currentPageAnchor || isAPI) {
|
||||
var isDocs = content.classList.contains('docs')
|
||||
|
||||
if (!isDocs) return
|
||||
|
||||
if (currentPageAnchor) {
|
||||
var sectionContainer
|
||||
|
||||
// if (false && isAPI) {
|
||||
|
|
@ -133,6 +136,7 @@
|
|||
currentPageAnchor.parentNode.appendChild(sectionContainer)
|
||||
|
||||
var h2s = content.querySelectorAll('h2')
|
||||
|
||||
if (h2s.length) {
|
||||
each.call(h2s, function (h) {
|
||||
sectionContainer.appendChild(makeLink(h))
|
||||
|
|
@ -140,7 +144,7 @@
|
|||
allLinks.push(h)
|
||||
allLinks.push.apply(allLinks, h3s)
|
||||
if (h3s.length) {
|
||||
sectionContainer.appendChild(makeSubLinks(h3s, isAPI))
|
||||
sectionContainer.appendChild(makeSubLinks(h3s, isDocs))
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue