Skip to content

Commit

Permalink
reorganize nav
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Dec 19, 2024
1 parent f24d0a4 commit 4f75ebd
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion sites/docs/src/content/utilities/animation-frames.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: AnimationFrames
description: A wrapper for requestAnimationFrame with FPS control and frame metrics
category: Browser
category: Animation
---

<script>
Expand Down
2 changes: 1 addition & 1 deletion sites/docs/src/content/utilities/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Context
description:
A wrapper around Svelte's Context API that provides type safety and improved ergonomics for
sharing data between components.
category: Utilities
category: State
---

<script>
Expand Down
2 changes: 1 addition & 1 deletion sites/docs/src/content/utilities/is-focus-within.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: IsFocusWithin
description:
A utility that tracks whether any descendant element has focus within a specified container
element.
category: Utilities
category: Elements
---

<script>
Expand Down
2 changes: 1 addition & 1 deletion sites/docs/src/content/utilities/is-idle.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: IsIdle
description: Track if a user is idle and the last time they were active.
category: Utilities
category: Sensors
---

<script>
Expand Down
4 changes: 2 additions & 2 deletions sites/docs/src/content/utilities/is-in-viewport.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: IsInViewport
description: N/A
category: Utilities
description: Track if an element is visible within the current viewport.
category: Elements
---

<script>
Expand Down
2 changes: 1 addition & 1 deletion sites/docs/src/content/utilities/pressed-keys.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: PressedKeys
description: Tracks which keys are currently pressed
category: Browser
category: Sensors
---

<script>
Expand Down
2 changes: 1 addition & 1 deletion sites/docs/src/content/utilities/use-geolocation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: useGeolocation
description: Reactive access to the browser's Geolocation API.
category: Browser
category: Sensors
---

<script>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: useIntersectionObserver
description: Watch for intersection changes of a target element.
category: Browser
category: Elements
---

<script>
Expand Down
2 changes: 1 addition & 1 deletion sites/docs/src/content/utilities/use-mutation-observer.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: useMutationObserver
description: Observe changes in an element
category: Browser
category: Elements
---

<script>
Expand Down
2 changes: 1 addition & 1 deletion sites/docs/src/content/utilities/use-resize-observer.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: useResizeObserver
description: Detects changes in the size of an element
category: Browser
category: Elements
---

<script>
Expand Down
14 changes: 12 additions & 2 deletions sites/docs/src/lib/config/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const elementsSection = docs.filter((doc) => doc.category === "Elements").map(do
const browserSection = docs.filter((doc) => doc.category === "Browser").map(docToNavItem);
const componentSection = docs.filter((doc) => doc.category === "Component").map(docToNavItem);
const utilitiesSection = docs.filter((doc) => doc.category === "Utilities").map(docToNavItem);
const animationSection = docs.filter((doc) => doc.category === "Animation").map(docToNavItem);
const sensorsSection = docs.filter((doc) => doc.category === "Sensors").map(docToNavItem);

export const navigation = defineNavigation({
anchors: [
Expand Down Expand Up @@ -59,12 +61,20 @@ export const navigation = defineNavigation({
items: browserSection,
},
{
title: "Component",
items: componentSection,
title: "Sensors",
items: sensorsSection,
},
{
title: "Animation",
items: animationSection,
},
{
title: "Utilities",
items: utilitiesSection,
},
{
title: "Component",
items: componentSection,
},
].filter((item) => item.items.length),
});
2 changes: 2 additions & 0 deletions sites/docs/velite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const baseSchema = s.object({
"Component",
"Utilities",
"Anchor",
"Animation",
"Sensors",
]),
});

Expand Down

0 comments on commit 4f75ebd

Please sign in to comment.