mirror of
https://github.com/seigler/awesome-dash-platform
synced 2025-07-27 06:36:08 +00:00
feat(nav): Enable top nav manual ordering
Add the "weight" parameter to categories Add sorting code to data.js to sort by the new parameter
This commit is contained in:
parent
324b792dae
commit
ce3f23e52d
3 changed files with 5 additions and 1 deletions
|
@ -13,10 +13,11 @@ module.exports = fs.readdirSync(dir)
|
|||
file.slug = slugify(file.title)
|
||||
file.type = 'category'
|
||||
|
||||
file.content = file.content.map(({ title, description, ...meta }, i) => ({
|
||||
file.content = file.content.map(({ title, description, weight, ...meta }, i) => ({
|
||||
...meta,
|
||||
title: trimIfExists(title),
|
||||
description: trimIfExists(description),
|
||||
weight: weight,
|
||||
category: file.slug,
|
||||
color: file.color,
|
||||
index: i
|
||||
|
@ -32,3 +33,4 @@ module.exports = fs.readdirSync(dir)
|
|||
return file
|
||||
})
|
||||
.sort((a, b) => sortAbc(a.title, b.title))
|
||||
.sort((a, b) => sortInv(a.weight, b.weight))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue