@dogsbay/docs-layout 0.2.0-beta.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 ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@dogsbay/docs-layout",
3
+ "version": "0.2.0-beta.0",
4
+ "description": "Standard documentation layout components for Dogsbay",
5
+ "type": "module",
6
+ "exports": {
7
+ "./DocsLayout.astro": "./src/DocsLayout.astro",
8
+ "./DocsSidebar.astro": "./src/DocsSidebar.astro",
9
+ "./DocsHeader.astro": "./src/DocsHeader.astro",
10
+ "./DocsToc.astro": "./src/DocsToc.astro",
11
+ "./DocsFooter.astro": "./src/DocsFooter.astro",
12
+ "./DocsNav.astro": "./src/DocsNav.astro",
13
+ "./TagList.astro": "./src/TagList.astro",
14
+ "./StatusBadge.astro": "./src/StatusBadge.astro",
15
+ "./TypeBadge.astro": "./src/TypeBadge.astro",
16
+ "./TaxonomyIndex.astro": "./src/TaxonomyIndex.astro",
17
+ "./TaxonomyTerm.astro": "./src/TaxonomyTerm.astro",
18
+ "./SearchDialog.astro": "./src/SearchDialog.astro",
19
+ "./PageActions.astro": "./src/PageActions.astro",
20
+ "./pagination": "./src/pagination.ts",
21
+ "./markdown-negotiation": "./src/markdown-negotiation.ts",
22
+ "./version-redirect": "./src/version-redirect.ts",
23
+ "./switcher": "./src/switcher.ts",
24
+ "./LocaleSwitcher.astro": "./src/LocaleSwitcher.astro",
25
+ "./nav-filter": "./src/nav-filter.ts",
26
+ "./search-facets": "./src/search-facets.ts",
27
+ "./tag-list-data": "./src/tag-list-data.ts",
28
+ "./llm-actions": "./src/llm-actions.ts",
29
+ "./json-ld": "./src/json-ld.ts"
30
+ },
31
+ "dependencies": {
32
+ "@dogsbay/ui": "0.2.0-beta.0",
33
+ "@dogsbay/primitives": "0.2.0-beta.0"
34
+ },
35
+ "devDependencies": {
36
+ "vitest": "^3.0.0"
37
+ },
38
+ "peerDependencies": {
39
+ "astro": "^5.0.0 || ^6.0.0"
40
+ },
41
+ "files": [
42
+ "src",
43
+ "README.md"
44
+ ],
45
+ "license": "MIT",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "https://github.com/dogsbay/dogsbay.git",
49
+ "directory": "packages/docs-layout"
50
+ },
51
+ "homepage": "https://github.com/dogsbay/dogsbay/tree/main/packages/docs-layout",
52
+ "bugs": {
53
+ "url": "https://github.com/dogsbay/dogsbay/issues"
54
+ },
55
+ "scripts": {
56
+ "test": "vitest run",
57
+ "test:watch": "vitest"
58
+ }
59
+ }
@@ -0,0 +1,96 @@
1
+ ---
2
+ /**
3
+ * Documentation page footer.
4
+ * Edit link, last updated, prev/next pagination.
5
+ */
6
+
7
+ interface PaginationLink {
8
+ label: string;
9
+ href: string;
10
+ }
11
+
12
+ interface Props {
13
+ editUrl?: string;
14
+ lastUpdated?: string;
15
+ prev?: PaginationLink;
16
+ next?: PaginationLink;
17
+ copyright?: string;
18
+ /**
19
+ * When true, render a low-key footer link to `/llms.txt` so
20
+ * agents and humans alike can discover the LLM index. Standard
21
+ * practice across Vercel / Stripe / Drizzle. See
22
+ * plans/llm-page-actions.md.
23
+ */
24
+ llmsLink?: boolean;
25
+ /** Path to llms.txt. Default `/llms.txt`. */
26
+ llmsLinkHref?: string;
27
+ class?: string;
28
+ }
29
+
30
+ const {
31
+ editUrl,
32
+ lastUpdated,
33
+ prev,
34
+ next,
35
+ copyright,
36
+ llmsLink = false,
37
+ llmsLinkHref = "/llms.txt",
38
+ class: className,
39
+ } = Astro.props;
40
+ ---
41
+
42
+ <footer class:list={["mt-12 border-t pt-6", className]}>
43
+ {/* Meta line: edit link + last updated */}
44
+ {(editUrl || lastUpdated) && (
45
+ <div class="mb-6 flex flex-wrap items-center gap-4 text-sm text-muted-foreground">
46
+ {editUrl && (
47
+ <a href={editUrl} target="_blank" rel="noopener" class="inline-flex items-center gap-1 hover:text-foreground">
48
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg>
49
+ Edit this page
50
+ </a>
51
+ )}
52
+ {lastUpdated && <span>Last updated: {lastUpdated}</span>}
53
+ </div>
54
+ )}
55
+
56
+ {/* Prev / Next */}
57
+ {(prev || next) && (
58
+ <nav class="flex items-center justify-between gap-4" aria-label="Page navigation">
59
+ {prev ? (
60
+ <a href={prev.href} class="inline-flex items-center gap-2 rounded-md border px-4 py-2 text-sm font-medium transition-colors hover:bg-accent" rel="prev">
61
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>
62
+ <div class="text-left">
63
+ <div class="text-xs text-muted-foreground">Previous</div>
64
+ <div>{prev.label}</div>
65
+ </div>
66
+ </a>
67
+ ) : <div />}
68
+ {next ? (
69
+ <a href={next.href} class="inline-flex items-center gap-2 rounded-md border px-4 py-2 text-sm font-medium transition-colors hover:bg-accent" rel="next">
70
+ <div class="text-right">
71
+ <div class="text-xs text-muted-foreground">Next</div>
72
+ <div>{next.label}</div>
73
+ </div>
74
+ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>
75
+ </a>
76
+ ) : <div />}
77
+ </nav>
78
+ )}
79
+
80
+ {/* Footer meta — copyright + agent-friendly llms.txt link */}
81
+ {(copyright || llmsLink) && (
82
+ <div class="mt-6 flex flex-wrap items-center justify-between gap-2 border-t pt-4 text-xs text-muted-foreground">
83
+ {copyright ? <span><Fragment set:html={copyright} /></span> : <span />}
84
+ {llmsLink && (
85
+ <a
86
+ href={llmsLinkHref}
87
+ class="hover:text-foreground"
88
+ data-llms-link
89
+ aria-label="View this site as llms.txt for LLMs"
90
+ >
91
+ View as llms.txt
92
+ </a>
93
+ )}
94
+ </div>
95
+ )}
96
+ </footer>
@@ -0,0 +1,41 @@
1
+ ---
2
+ /**
3
+ * Standard docs site header.
4
+ * Sticky, frosted glass, with mobile menu toggle + dark mode + optional repo link.
5
+ */
6
+
7
+ interface Props {
8
+ siteName: string;
9
+ siteUrl?: string;
10
+ repoUrl?: string;
11
+ class?: string;
12
+ }
13
+
14
+ const { siteName, siteUrl = "/", repoUrl, class: className } = Astro.props;
15
+ ---
16
+
17
+ <header class:list={["sticky top-0 z-40 flex h-14 items-center gap-4 border-b bg-background/95 px-4 backdrop-blur-sm supports-[backdrop-filter]:bg-background/60", className]}>
18
+ <!-- Mobile menu button -->
19
+ <button data-docs-menu-toggle class="lg:hidden" aria-label="Toggle menu">
20
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" y1="6" x2="20" y2="6"/><line x1="4" y1="12" x2="20" y2="12"/><line x1="4" y1="18" x2="20" y2="18"/></svg>
21
+ </button>
22
+
23
+ <a href={siteUrl} class="text-lg font-bold text-foreground no-underline">{siteName}</a>
24
+
25
+ <!-- Slot for additional header content (search, nav tabs, etc.) -->
26
+ <div class="ml-auto flex items-center gap-2">
27
+ <slot />
28
+
29
+ {repoUrl && (
30
+ <a href={repoUrl} target="_blank" rel="noopener" class="rounded-md p-2 text-muted-foreground hover:bg-accent hover:text-foreground" aria-label="Source repository">
31
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
32
+ </a>
33
+ )}
34
+
35
+ <!-- Dark mode toggle -->
36
+ <button data-docs-theme-toggle class="rounded-md p-2 text-muted-foreground hover:bg-accent hover:text-foreground" aria-label="Toggle dark mode">
37
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="hidden dark:block"><circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/></svg>
38
+ <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="block dark:hidden"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>
39
+ </button>
40
+ </div>
41
+ </header>