@karaoke-cms/module-docs 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/src/css-contract.ts +15 -3
- package/src/pages/doc.astro +1 -2
- package/src/pages/home.astro +2 -2
- package/src/pages/list.astro +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@karaoke-cms/module-docs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.14.0",
|
|
5
5
|
"description": "Docs module for karaoke-cms — documentation pages with sidebar navigation",
|
|
6
6
|
"main": "./src/index.ts",
|
|
7
7
|
"exports": {
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
],
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"astro": ">=6.0.0",
|
|
26
|
-
"@karaoke-cms/contracts": "^0.
|
|
26
|
+
"@karaoke-cms/contracts": "^0.14.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"astro": "^6.0.8",
|
|
30
30
|
"vitest": "^4.1.1",
|
|
31
|
-
"@karaoke-cms/astro": "0.
|
|
32
|
-
"@karaoke-cms/contracts": "0.
|
|
31
|
+
"@karaoke-cms/astro": "0.14.0",
|
|
32
|
+
"@karaoke-cms/contracts": "0.14.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"test": "vitest run test/docs-factory.test.js"
|
package/src/css-contract.ts
CHANGED
|
@@ -24,7 +24,19 @@ export const cssContract: CssContract = {
|
|
|
24
24
|
'docs-tag': { description: 'Tag chip on doc card or article', required: false },
|
|
25
25
|
'docs-tag-list': { description: 'Wrapper around a list of doc tag chips', required: false },
|
|
26
26
|
// Sidebar navigation
|
|
27
|
-
'docs-sidebar':
|
|
28
|
-
'docs-sidebar-list':
|
|
29
|
-
'docs-sidebar-item':
|
|
27
|
+
'docs-sidebar': { description: 'Sidebar nav wrapper', required: true },
|
|
28
|
+
'docs-sidebar-list': { description: 'List of nav links inside the sidebar (legacy)', required: false },
|
|
29
|
+
'docs-sidebar-item': { description: 'Individual nav link in the sidebar (legacy)', required: false },
|
|
30
|
+
'docs-sidebar-wrap': { description: '<details> collapsible wrapper for sidebar panels', required: true },
|
|
31
|
+
'docs-sidebar-toggle': { description: '<summary> toggle header for sidebar panels', required: true },
|
|
32
|
+
// Tree navigation
|
|
33
|
+
'docs-tree': { description: 'Tree <ul> at any depth level', required: true },
|
|
34
|
+
'docs-tree-root': { description: 'Modifier on the top-level docs-tree', required: false },
|
|
35
|
+
'docs-tree-dir': { description: 'Directory <li> node in the tree', required: true },
|
|
36
|
+
'docs-tree-summary': { description: '<summary> header of a directory node', required: true },
|
|
37
|
+
'docs-tree-dir-name': { description: 'Plain label for a dir without an associated page', required: false },
|
|
38
|
+
'docs-tree-dir-link': { description: 'Link on a dir that has an associated page', required: false },
|
|
39
|
+
'docs-tree-file': { description: 'File <li> (leaf) node in the tree', required: true },
|
|
40
|
+
// Right sidebar
|
|
41
|
+
'docs-page-nav': { description: 'Right sidebar showing siblings of current page', required: false },
|
|
30
42
|
};
|
package/src/pages/doc.astro
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
import { getCollection, render } from 'astro:content';
|
|
5
5
|
import DefaultPage from '@karaoke-cms/astro/layouts/DefaultPage.astro';
|
|
6
6
|
import ModuleLoader from '@karaoke-cms/astro/components/ModuleLoader.astro';
|
|
7
|
-
import { siteTitle } from 'virtual:karaoke-cms/config';
|
|
8
7
|
import { resolveWikiImage } from '@karaoke-cms/astro';
|
|
9
8
|
|
|
10
9
|
export async function getStaticPaths() {
|
|
@@ -23,7 +22,7 @@ const allDocs = (await getCollection('docs', ({ data }) => data.publish === true
|
|
|
23
22
|
.sort((a, b) => a.data.title.localeCompare(b.data.title));
|
|
24
23
|
---
|
|
25
24
|
|
|
26
|
-
<DefaultPage title={
|
|
25
|
+
<DefaultPage title={entry.data.title} description={entry.data.description} type="article">
|
|
27
26
|
<nav class="docs-sidebar" slot="left">
|
|
28
27
|
<ul class="docs-sidebar-list">
|
|
29
28
|
{allDocs.map(doc => (
|
package/src/pages/home.astro
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
// For now, mount is assumed to be /docs.
|
|
4
4
|
import { getCollection } from 'astro:content';
|
|
5
5
|
import DefaultPage from '@karaoke-cms/astro/layouts/DefaultPage.astro';
|
|
6
|
-
import {
|
|
6
|
+
import { siteDescription } from 'virtual:karaoke-cms/config';
|
|
7
7
|
|
|
8
8
|
const docs = (await getCollection('docs', ({ data }) => data.publish === true))
|
|
9
9
|
.sort((a, b) => a.data.title.localeCompare(b.data.title));
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
<DefaultPage title=
|
|
12
|
+
<DefaultPage title="Docs" description={siteDescription}>
|
|
13
13
|
<div class="docs-home">
|
|
14
14
|
<h1>Docs</h1>
|
|
15
15
|
{docs.length > 0 ? (
|
package/src/pages/list.astro
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
// For now, mount is assumed to be /docs.
|
|
4
4
|
import { getCollection } from 'astro:content';
|
|
5
5
|
import DefaultPage from '@karaoke-cms/astro/layouts/DefaultPage.astro';
|
|
6
|
-
import {
|
|
6
|
+
import { siteDescription } from 'virtual:karaoke-cms/config';
|
|
7
7
|
|
|
8
8
|
const docs = (await getCollection('docs', ({ data }) => data.publish === true))
|
|
9
9
|
.sort((a, b) => a.data.title.localeCompare(b.data.title));
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
<DefaultPage title=
|
|
12
|
+
<DefaultPage title="All Docs" description={siteDescription}>
|
|
13
13
|
<div class="docs-list">
|
|
14
14
|
<h1>All Docs</h1>
|
|
15
15
|
{docs.length > 0 ? (
|