fixed submenus not working
11ty build and deploy for ${{ gitea.repository }} / build-deploy (push) Successful in 24s
Details
11ty build and deploy for ${{ gitea.repository }} / build-deploy (push) Successful in 24s
Details
This commit is contained in:
parent
7fe72ad9b6
commit
7eb8dec838
|
@ -46,7 +46,7 @@ module.exports = (config) => {
|
||||||
let sorted = []
|
let sorted = []
|
||||||
let unsorted = []
|
let unsorted = []
|
||||||
|
|
||||||
let pages = collection.getFilteredByGlob(`src/_content/work/${cat}/*.md`)
|
let pages = collection.getFilteredByGlob(`_content/${cat}/*.md`)
|
||||||
|
|
||||||
for (let page of pages) {
|
for (let page of pages) {
|
||||||
if (page.data.sort) {
|
if (page.data.sort) {
|
||||||
|
@ -66,7 +66,6 @@ module.exports = (config) => {
|
||||||
|
|
||||||
let _p = collection.getFilteredByGlob('_content/*.md')
|
let _p = collection.getFilteredByGlob('_content/*.md')
|
||||||
let pages = {}
|
let pages = {}
|
||||||
// _cat = { ..._cat, ...pages }
|
|
||||||
|
|
||||||
_p.forEach(p => {
|
_p.forEach(p => {
|
||||||
if (p.data.title != 'index') {
|
if (p.data.title != 'index') {
|
||||||
|
|
|
@ -13,7 +13,7 @@ class NavPrimary extends HTMLElement {
|
||||||
this.setupAudio()
|
this.setupAudio()
|
||||||
|
|
||||||
this.categories = this.querySelectorAll('nav-link')
|
this.categories = this.querySelectorAll('nav-link')
|
||||||
this.subs = this.querySelectorAll('ul')
|
this.subs = this.querySelectorAll('#sub ul')
|
||||||
|
|
||||||
this.activate()
|
this.activate()
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ class NavPrimary extends HTMLElement {
|
||||||
const category = n.attributes.getNamedItem('category')
|
const category = n.attributes.getNamedItem('category')
|
||||||
const link = n.attributes.getNamedItem('link')
|
const link = n.attributes.getNamedItem('link')
|
||||||
|
|
||||||
console.log(link)
|
console.log('category click', link, category)
|
||||||
|
|
||||||
if (link) {
|
if (link) {
|
||||||
history.pushState({}, '', link.value)
|
history.pushState({}, '', link.value)
|
||||||
|
@ -63,7 +63,6 @@ class NavPrimary extends HTMLElement {
|
||||||
activate() {
|
activate() {
|
||||||
let active, toOpen
|
let active, toOpen
|
||||||
|
|
||||||
|
|
||||||
this.categories.forEach(c => {
|
this.categories.forEach(c => {
|
||||||
const { value } = c.attributes.getNamedItem('category') || false
|
const { value } = c.attributes.getNamedItem('category') || false
|
||||||
|
|
||||||
|
@ -74,6 +73,7 @@ class NavPrimary extends HTMLElement {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
console.log(this.subs)
|
||||||
this.subs.forEach(s => {
|
this.subs.forEach(s => {
|
||||||
const { name } = s.dataset
|
const { name } = s.dataset
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue