@autumnsgrove/groveengine 0.1.0 → 0.3.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/dist/components/admin/GutterManager.svelte +1 -2
- package/dist/components/admin/MarkdownEditor.svelte +1 -2
- package/dist/components/custom/InternalsPostViewer.svelte +95 -0
- package/dist/components/custom/InternalsPostViewer.svelte.d.ts +13 -0
- package/dist/components/ui/index.d.ts +0 -12
- package/dist/components/ui/index.js +2 -13
- package/dist/components/ui/select/select-separator.svelte +2 -3
- package/dist/components/ui/select/select-separator.svelte.d.ts +1 -1
- package/dist/utils/markdown.d.ts +130 -66
- package/dist/utils/markdown.js +482 -568
- package/package.json +2 -1
- package/dist/components/ui/Badge.svelte +0 -48
- package/dist/components/ui/Badge.svelte.d.ts +0 -26
- package/dist/components/ui/Button.svelte +0 -74
- package/dist/components/ui/Button.svelte.d.ts +0 -34
- package/dist/components/ui/Card.svelte +0 -102
- package/dist/components/ui/Card.svelte.d.ts +0 -46
- package/dist/components/ui/Input.svelte +0 -81
- package/dist/components/ui/Input.svelte.d.ts +0 -35
- package/dist/components/ui/Skeleton.svelte +0 -31
- package/dist/components/ui/Skeleton.svelte.d.ts +0 -26
- package/dist/components/ui/Textarea.svelte +0 -81
- package/dist/components/ui/Textarea.svelte.d.ts +0 -35
- package/dist/components/ui/badge/badge.svelte +0 -50
- package/dist/components/ui/badge/badge.svelte.d.ts +0 -60
- package/dist/components/ui/badge/index.d.ts +0 -2
- package/dist/components/ui/badge/index.js +0 -2
- package/dist/components/ui/button/button.svelte +0 -82
- package/dist/components/ui/button/button.svelte.d.ts +0 -132
- package/dist/components/ui/button/index.d.ts +0 -2
- package/dist/components/ui/button/index.js +0 -4
- package/dist/components/ui/card/card-content.svelte +0 -16
- package/dist/components/ui/card/card-content.svelte.d.ts +0 -5
- package/dist/components/ui/card/card-description.svelte +0 -16
- package/dist/components/ui/card/card-description.svelte.d.ts +0 -5
- package/dist/components/ui/card/card-footer.svelte +0 -16
- package/dist/components/ui/card/card-footer.svelte.d.ts +0 -5
- package/dist/components/ui/card/card-header.svelte +0 -16
- package/dist/components/ui/card/card-header.svelte.d.ts +0 -5
- package/dist/components/ui/card/card-title.svelte +0 -25
- package/dist/components/ui/card/card-title.svelte.d.ts +0 -8
- package/dist/components/ui/card/card.svelte +0 -20
- package/dist/components/ui/card/card.svelte.d.ts +0 -5
- package/dist/components/ui/card/index.d.ts +0 -7
- package/dist/components/ui/card/index.js +0 -9
- package/dist/components/ui/input/index.d.ts +0 -2
- package/dist/components/ui/input/index.js +0 -4
- package/dist/components/ui/input/input.svelte +0 -46
- package/dist/components/ui/input/input.svelte.d.ts +0 -13
- package/dist/components/ui/separator/index.d.ts +0 -2
- package/dist/components/ui/separator/index.js +0 -4
- package/dist/components/ui/separator/separator.svelte +0 -22
- package/dist/components/ui/separator/separator.svelte.d.ts +0 -4
- package/dist/components/ui/skeleton/index.d.ts +0 -2
- package/dist/components/ui/skeleton/index.js +0 -4
- package/dist/components/ui/skeleton/skeleton.svelte +0 -17
- package/dist/components/ui/skeleton/skeleton.svelte.d.ts +0 -5
- package/dist/components/ui/textarea/index.d.ts +0 -2
- package/dist/components/ui/textarea/index.js +0 -4
- package/dist/components/ui/textarea/textarea.svelte +0 -24
- package/dist/components/ui/textarea/textarea.svelte.d.ts +0 -6
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { marked } from "marked";
|
|
3
|
+
import { Input, Button } from '@groveengine/ui';
|
|
3
4
|
import Dialog from "../ui/Dialog.svelte";
|
|
4
|
-
import Input from "../ui/Input.svelte";
|
|
5
|
-
import Button from "../ui/Button.svelte";
|
|
6
5
|
import Select from "../ui/Select.svelte";
|
|
7
6
|
import { toast } from "../ui/toast";
|
|
8
7
|
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
import { onMount, tick } from "svelte";
|
|
5
5
|
import { sanitizeMarkdown } from "../../utils/sanitize.js";
|
|
6
6
|
import "../../styles/content.css";
|
|
7
|
+
import { Button, Input } from '@groveengine/ui';
|
|
7
8
|
import Dialog from "../ui/Dialog.svelte";
|
|
8
|
-
import Button from "../ui/Button.svelte";
|
|
9
|
-
import Input from "../ui/Input.svelte";
|
|
10
9
|
|
|
11
10
|
// Initialize mermaid with grove-themed dark config
|
|
12
11
|
mermaid.initialize({
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
/**
|
|
3
|
+
* Simple component to display a featured blog post
|
|
4
|
+
* @prop {{ title: string; description?: string; slug: string; date?: string }} post - Post data
|
|
5
|
+
* @prop {string} [caption] - Optional caption text
|
|
6
|
+
*/
|
|
7
|
+
let { post, caption = "" } = $props();
|
|
8
|
+
|
|
9
|
+
const formattedDate = $derived(post.date ? new Date(post.date).toLocaleDateString('en-US', {
|
|
10
|
+
year: 'numeric',
|
|
11
|
+
month: 'long',
|
|
12
|
+
day: 'numeric'
|
|
13
|
+
}) : null);
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<article class="post-viewer">
|
|
17
|
+
{#if caption}
|
|
18
|
+
<span class="caption">{caption}</span>
|
|
19
|
+
{/if}
|
|
20
|
+
<a href="/blog/{post.slug}" class="post-link">
|
|
21
|
+
<h3 class="title">{post.title}</h3>
|
|
22
|
+
{#if post.description}
|
|
23
|
+
<p class="description">{post.description}</p>
|
|
24
|
+
{/if}
|
|
25
|
+
{#if formattedDate}
|
|
26
|
+
<time class="date">{formattedDate}</time>
|
|
27
|
+
{/if}
|
|
28
|
+
</a>
|
|
29
|
+
</article>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
.post-viewer {
|
|
33
|
+
background: var(--color-bg-secondary);
|
|
34
|
+
border: 1px solid var(--color-border);
|
|
35
|
+
border-radius: var(--border-radius-standard);
|
|
36
|
+
padding: 1.5rem;
|
|
37
|
+
transition: all 0.3s ease;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.caption {
|
|
41
|
+
display: block;
|
|
42
|
+
font-size: 0.75rem;
|
|
43
|
+
text-transform: uppercase;
|
|
44
|
+
letter-spacing: 0.05em;
|
|
45
|
+
color: var(--color-primary);
|
|
46
|
+
margin-bottom: 0.5rem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.post-link {
|
|
50
|
+
text-decoration: none;
|
|
51
|
+
color: inherit;
|
|
52
|
+
display: block;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.post-link:hover .title {
|
|
56
|
+
color: var(--color-primary);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.title {
|
|
60
|
+
font-size: 1.25rem;
|
|
61
|
+
margin: 0 0 0.5rem 0;
|
|
62
|
+
color: var(--color-text);
|
|
63
|
+
transition: color 0.2s ease;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.description {
|
|
67
|
+
margin: 0 0 0.75rem 0;
|
|
68
|
+
color: var(--color-text-muted);
|
|
69
|
+
font-size: 0.95rem;
|
|
70
|
+
line-height: 1.6;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.date {
|
|
74
|
+
display: block;
|
|
75
|
+
font-size: 0.875rem;
|
|
76
|
+
color: var(--color-text-subtle);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
:global(.dark) .post-viewer {
|
|
80
|
+
background: var(--color-bg-tertiary-dark);
|
|
81
|
+
border-color: var(--color-border-dark);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:global(.dark) .title {
|
|
85
|
+
color: var(--color-text-dark);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:global(.dark) .description {
|
|
89
|
+
color: var(--color-text-subtle-dark);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:global(.dark) .date {
|
|
93
|
+
color: var(--color-text-subtle-dark);
|
|
94
|
+
}
|
|
95
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default InternalsPostViewer;
|
|
2
|
+
type InternalsPostViewer = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const InternalsPostViewer: import("svelte").Component<{
|
|
7
|
+
post: any;
|
|
8
|
+
caption?: string;
|
|
9
|
+
}, {}, "">;
|
|
10
|
+
type $$ComponentProps = {
|
|
11
|
+
post: any;
|
|
12
|
+
caption?: string;
|
|
13
|
+
};
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
export { default as Button } from "./Button.svelte";
|
|
2
|
-
export { default as Card } from "./Card.svelte";
|
|
3
|
-
export { default as Badge } from "./Badge.svelte";
|
|
4
1
|
export { default as Dialog } from "./Dialog.svelte";
|
|
5
|
-
export { default as Input } from "./Input.svelte";
|
|
6
|
-
export { default as Textarea } from "./Textarea.svelte";
|
|
7
2
|
export { default as Select } from "./Select.svelte";
|
|
8
3
|
export { default as Tabs } from "./Tabs.svelte";
|
|
9
4
|
export { default as Accordion } from "./Accordion.svelte";
|
|
10
5
|
export { default as Sheet } from "./Sheet.svelte";
|
|
11
6
|
export { default as Toast } from "./Toast.svelte";
|
|
12
|
-
export { default as Skeleton } from "./Skeleton.svelte";
|
|
13
7
|
export { default as Table } from "./Table.svelte";
|
|
14
8
|
export { toast } from "./toast";
|
|
15
9
|
export { Root as DialogRoot, Trigger as DialogTrigger, Close as DialogClose, Portal as DialogPortal } from "./dialog";
|
|
16
10
|
export { Root as SheetRoot, Trigger as SheetTrigger, Close as SheetClose, Portal as SheetPortal, Content as SheetContent, Header as SheetHeader, Footer as SheetFooter, Title as SheetTitle, Description as SheetDescription } from "./sheet";
|
|
17
11
|
export { Root as TableRoot, Body as TableBody, Caption as TableCaption, Cell as TableCell, Footer as TableFooter, Head as TableHead, Header as TableHeader, Row as TableRow } from "./table";
|
|
18
|
-
export { Root as SkeletonRoot, Skeleton as SkeletonComponent } from "./skeleton";
|
|
19
12
|
export { Root as AccordionRoot } from "./accordion";
|
|
20
|
-
export { Root as BadgeRoot } from "./badge";
|
|
21
|
-
export { Root as ButtonRoot } from "./button";
|
|
22
|
-
export { Root as CardRoot, Header as CardHeader, Title as CardTitle, Description as CardDescription, Content as CardContent, Footer as CardFooter } from "./card";
|
|
23
|
-
export { Root as InputRoot } from "./input";
|
|
24
|
-
export { Root as TextareaRoot } from "./textarea";
|
|
25
13
|
export { Root as SelectRoot, Trigger as SelectTrigger, Content as SelectContent, Item as SelectItem, Group as SelectGroup, GroupHeading as SelectLabel, Separator as SelectSeparator, ScrollUpButton as SelectScrollUpButton, ScrollDownButton as SelectScrollDownButton } from "./select";
|
|
26
14
|
export { Root as TabsRoot, List as TabsList, Trigger as TabsTrigger, Content as TabsContent } from "./tabs";
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
export { default as Card } from "./Card.svelte";
|
|
4
|
-
export { default as Badge } from "./Badge.svelte";
|
|
1
|
+
// Admin-specific UI component wrappers
|
|
2
|
+
// Generic UI components (Button, Card, Badge, Input, Textarea, Skeleton) are now in @groveengine/ui
|
|
5
3
|
export { default as Dialog } from "./Dialog.svelte";
|
|
6
|
-
export { default as Input } from "./Input.svelte";
|
|
7
|
-
export { default as Textarea } from "./Textarea.svelte";
|
|
8
4
|
export { default as Select } from "./Select.svelte";
|
|
9
5
|
export { default as Tabs } from "./Tabs.svelte";
|
|
10
6
|
export { default as Accordion } from "./Accordion.svelte";
|
|
11
7
|
export { default as Sheet } from "./Sheet.svelte";
|
|
12
8
|
export { default as Toast } from "./Toast.svelte";
|
|
13
|
-
export { default as Skeleton } from "./Skeleton.svelte";
|
|
14
9
|
export { default as Table } from "./Table.svelte";
|
|
15
10
|
// Toast utilities
|
|
16
11
|
export { toast } from "./toast";
|
|
@@ -18,12 +13,6 @@ export { toast } from "./toast";
|
|
|
18
13
|
export { Root as DialogRoot, Trigger as DialogTrigger, Close as DialogClose, Portal as DialogPortal } from "./dialog";
|
|
19
14
|
export { Root as SheetRoot, Trigger as SheetTrigger, Close as SheetClose, Portal as SheetPortal, Content as SheetContent, Header as SheetHeader, Footer as SheetFooter, Title as SheetTitle, Description as SheetDescription } from "./sheet";
|
|
20
15
|
export { Root as TableRoot, Body as TableBody, Caption as TableCaption, Cell as TableCell, Footer as TableFooter, Head as TableHead, Header as TableHeader, Row as TableRow } from "./table";
|
|
21
|
-
export { Root as SkeletonRoot, Skeleton as SkeletonComponent } from "./skeleton";
|
|
22
16
|
export { Root as AccordionRoot } from "./accordion";
|
|
23
|
-
export { Root as BadgeRoot } from "./badge";
|
|
24
|
-
export { Root as ButtonRoot } from "./button";
|
|
25
|
-
export { Root as CardRoot, Header as CardHeader, Title as CardTitle, Description as CardDescription, Content as CardContent, Footer as CardFooter } from "./card";
|
|
26
|
-
export { Root as InputRoot } from "./input";
|
|
27
|
-
export { Root as TextareaRoot } from "./textarea";
|
|
28
17
|
export { Root as SelectRoot, Trigger as SelectTrigger, Content as SelectContent, Item as SelectItem, Group as SelectGroup, GroupHeading as SelectLabel, Separator as SelectSeparator, ScrollUpButton as SelectScrollUpButton, ScrollDownButton as SelectScrollDownButton } from "./select";
|
|
29
18
|
export { Root as TabsRoot, List as TabsList, Trigger as TabsTrigger, Content as TabsContent } from "./tabs";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import { Separator } from "../separator/index.js";
|
|
2
|
+
import { Separator as SeparatorPrimitive } from "bits-ui";
|
|
4
3
|
import { cn } from "../../../utils";
|
|
5
4
|
|
|
6
5
|
let {
|
|
@@ -10,4 +9,4 @@
|
|
|
10
9
|
}: SeparatorPrimitive.RootProps = $props();
|
|
11
10
|
</script>
|
|
12
11
|
|
|
13
|
-
<
|
|
12
|
+
<SeparatorPrimitive.Root bind:ref class={cn("bg-muted -mx-1 my-1 h-px", className)} {...restProps} />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Separator as SeparatorPrimitive } from "bits-ui";
|
|
2
2
|
declare const SelectSeparator: import("svelte").Component<SeparatorPrimitive.RootProps, {}, "ref">;
|
|
3
3
|
type SelectSeparator = ReturnType<typeof SelectSeparator>;
|
|
4
4
|
export default SelectSeparator;
|
package/dist/utils/markdown.d.ts
CHANGED
|
@@ -1,29 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Get the site configuration
|
|
3
|
-
* @returns {Object} Site configuration object
|
|
4
|
-
*/
|
|
5
|
-
export function getSiteConfig(): Object;
|
|
6
|
-
/**
|
|
7
|
-
* Get all markdown posts from the posts directory
|
|
8
|
-
* @returns {Array} Array of post objects with metadata and slug
|
|
9
|
-
*/
|
|
10
|
-
export function getAllPosts(): any[];
|
|
11
|
-
/**
|
|
12
|
-
* Get the latest (most recent) post with full content
|
|
13
|
-
* @returns {Object|null} The latest post object with content, or null if no posts exist
|
|
14
|
-
*/
|
|
15
|
-
export function getLatestPost(): Object | null;
|
|
16
|
-
/**
|
|
17
|
-
* Get all recipes from the recipes directory
|
|
18
|
-
* @returns {Array} Array of recipe objects with metadata and slug
|
|
19
|
-
*/
|
|
20
|
-
export function getAllRecipes(): any[];
|
|
21
|
-
/**
|
|
22
|
-
* Get a single post by slug
|
|
23
|
-
* @param {string} slug - The post slug
|
|
24
|
-
* @returns {Object|null} Post object with content and metadata
|
|
25
|
-
*/
|
|
26
|
-
export function getPostBySlug(slug: string): Object | null;
|
|
27
1
|
/**
|
|
28
2
|
* Extract headers from markdown content for table of contents
|
|
29
3
|
* @param {string} markdown - The raw markdown content
|
|
@@ -38,64 +12,154 @@ export function extractHeaders(markdown: string): any[];
|
|
|
38
12
|
*/
|
|
39
13
|
export function processAnchorTags(html: string): string;
|
|
40
14
|
/**
|
|
41
|
-
*
|
|
42
|
-
* @param {string}
|
|
43
|
-
* @returns {
|
|
15
|
+
* Process Mermaid diagrams in markdown content
|
|
16
|
+
* @param {string} markdown - The markdown content
|
|
17
|
+
* @returns {string} Processed markdown with Mermaid diagrams
|
|
44
18
|
*/
|
|
45
|
-
export function
|
|
19
|
+
export function processMermaidDiagrams(markdown: string): string;
|
|
46
20
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* @returns {Array} Array of gutter items with content and position info
|
|
21
|
+
* Render Mermaid diagrams in the DOM
|
|
22
|
+
* This should be called after the content is mounted
|
|
50
23
|
*/
|
|
51
|
-
export function
|
|
24
|
+
export function renderMermaidDiagrams(): Promise<void>;
|
|
52
25
|
/**
|
|
53
|
-
*
|
|
54
|
-
* @param {string}
|
|
55
|
-
* @returns {
|
|
26
|
+
* Parse markdown content and convert to HTML
|
|
27
|
+
* @param {string} markdownContent - The raw markdown content (may include frontmatter)
|
|
28
|
+
* @returns {Object} Object with data (frontmatter), content (HTML), headers, and raw markdown
|
|
56
29
|
*/
|
|
57
|
-
export function
|
|
30
|
+
export function parseMarkdownContent(markdownContent: string): Object;
|
|
58
31
|
/**
|
|
59
|
-
*
|
|
60
|
-
* @param {string}
|
|
61
|
-
* @returns {
|
|
32
|
+
* Parse markdown content with sanitization (for user-facing pages like home, about, contact)
|
|
33
|
+
* @param {string} markdownContent - The raw markdown content (may include frontmatter)
|
|
34
|
+
* @returns {Object} Object with data (frontmatter), content (sanitized HTML), headers
|
|
62
35
|
*/
|
|
63
|
-
export function
|
|
36
|
+
export function parseMarkdownContentSanitized(markdownContent: string): Object;
|
|
64
37
|
/**
|
|
65
|
-
* Get
|
|
66
|
-
*
|
|
38
|
+
* Get gutter content from provided modules
|
|
39
|
+
* This is a utility function that processes gutter manifests, markdown, and images
|
|
40
|
+
*
|
|
41
|
+
* @param {string} slug - The page/post slug
|
|
42
|
+
* @param {Object} manifestModules - The manifest modules (from import.meta.glob)
|
|
43
|
+
* @param {Object} markdownModules - The markdown modules (from import.meta.glob)
|
|
44
|
+
* @param {Object} imageModules - The image modules (from import.meta.glob)
|
|
45
|
+
* @returns {Array} Array of gutter items with content and position info
|
|
67
46
|
*/
|
|
68
|
-
export function
|
|
47
|
+
export function processGutterContent(slug: string, manifestModules: Object, markdownModules: Object, imageModules: Object): any[];
|
|
48
|
+
/**
|
|
49
|
+
* Process a list of markdown files into post/recipe objects
|
|
50
|
+
*
|
|
51
|
+
* @param {Object} modules - The modules from import.meta.glob (filepath -> content)
|
|
52
|
+
* @returns {Array} Array of post/content objects with metadata and slug
|
|
53
|
+
*/
|
|
54
|
+
export function processMarkdownModules(modules: Object): any[];
|
|
55
|
+
/**
|
|
56
|
+
* Get a single item by slug from modules
|
|
57
|
+
*
|
|
58
|
+
* @param {string} slug - The item slug
|
|
59
|
+
* @param {Object} modules - The modules from import.meta.glob (filepath -> content)
|
|
60
|
+
* @param {Object} options - Optional configuration
|
|
61
|
+
* @param {Object} options.gutterModules - Gutter modules { manifest, markdown, images }
|
|
62
|
+
* @param {Object} options.sidecarModules - Sidecar/metadata modules (for recipes)
|
|
63
|
+
* @returns {Object|null} Item object with content and metadata
|
|
64
|
+
*/
|
|
65
|
+
export function getItemBySlug(slug: string, modules: Object, options?: {
|
|
66
|
+
gutterModules: Object;
|
|
67
|
+
sidecarModules: Object;
|
|
68
|
+
}): Object | null;
|
|
69
|
+
/**
|
|
70
|
+
* Get a page (home, about, contact) by filename from modules
|
|
71
|
+
* Uses sanitization for security
|
|
72
|
+
*
|
|
73
|
+
* @param {string} filename - The filename to look for (e.g., "home.md", "about.md")
|
|
74
|
+
* @param {Object} modules - The modules from import.meta.glob (filepath -> content)
|
|
75
|
+
* @param {Object} options - Optional configuration
|
|
76
|
+
* @param {Object} options.gutterModules - Gutter modules { manifest, markdown, images }
|
|
77
|
+
* @param {string} options.slug - Override slug (defaults to filename without .md)
|
|
78
|
+
* @returns {Object|null} Page object with content and metadata
|
|
79
|
+
*/
|
|
80
|
+
export function getPageByFilename(filename: string, modules: Object, options?: {
|
|
81
|
+
gutterModules: Object;
|
|
82
|
+
slug: string;
|
|
83
|
+
}): Object | null;
|
|
84
|
+
/**
|
|
85
|
+
* Get site configuration from a config module
|
|
86
|
+
*
|
|
87
|
+
* @param {Object} configModule - The config module from import.meta.glob
|
|
88
|
+
* @returns {Object} Site configuration object
|
|
89
|
+
*/
|
|
90
|
+
export function getSiteConfigFromModule(configModule: Object): Object;
|
|
91
|
+
/**
|
|
92
|
+
* Create a configured content loader with all functions bound to the provided modules
|
|
93
|
+
* This is the main factory function for creating a content loader in the consuming app
|
|
94
|
+
*
|
|
95
|
+
* @param {Object} config - Configuration object with all required modules
|
|
96
|
+
* @param {Object} config.posts - Post modules from import.meta.glob
|
|
97
|
+
* @param {Object} config.recipes - Recipe modules from import.meta.glob
|
|
98
|
+
* @param {Object} config.about - About page modules from import.meta.glob
|
|
99
|
+
* @param {Object} config.home - Home page modules from import.meta.glob
|
|
100
|
+
* @param {Object} config.contact - Contact page modules from import.meta.glob
|
|
101
|
+
* @param {Object} config.siteConfig - Site config module from import.meta.glob
|
|
102
|
+
* @param {Object} config.postGutter - Post gutter modules { manifest, markdown, images }
|
|
103
|
+
* @param {Object} config.recipeGutter - Recipe gutter modules { manifest, markdown, images }
|
|
104
|
+
* @param {Object} config.recipeMetadata - Recipe metadata modules from import.meta.glob
|
|
105
|
+
* @param {Object} config.aboutGutter - About gutter modules { manifest, markdown, images }
|
|
106
|
+
* @param {Object} config.homeGutter - Home gutter modules { manifest, markdown, images }
|
|
107
|
+
* @param {Object} config.contactGutter - Contact gutter modules { manifest, markdown, images }
|
|
108
|
+
* @returns {Object} Object with all content loader functions
|
|
109
|
+
*/
|
|
110
|
+
export function createContentLoader(config: {
|
|
111
|
+
posts: Object;
|
|
112
|
+
recipes: Object;
|
|
113
|
+
about: Object;
|
|
114
|
+
home: Object;
|
|
115
|
+
contact: Object;
|
|
116
|
+
siteConfig: Object;
|
|
117
|
+
postGutter: Object;
|
|
118
|
+
recipeGutter: Object;
|
|
119
|
+
recipeMetadata: Object;
|
|
120
|
+
aboutGutter: Object;
|
|
121
|
+
homeGutter: Object;
|
|
122
|
+
contactGutter: Object;
|
|
123
|
+
}): Object;
|
|
124
|
+
/**
|
|
125
|
+
* Register a content loader for the site
|
|
126
|
+
* This should be called by the consuming site to provide access to content
|
|
127
|
+
* @param {Object} loader - Object with getAllPosts, getSiteConfig, getLatestPost functions
|
|
128
|
+
*/
|
|
129
|
+
export function registerContentLoader(loader: Object): void;
|
|
130
|
+
/**
|
|
131
|
+
* Get all blog posts
|
|
132
|
+
* @returns {Array} Array of post objects
|
|
133
|
+
*/
|
|
134
|
+
export function getAllPosts(): any[];
|
|
69
135
|
/**
|
|
70
|
-
* Get
|
|
71
|
-
* @returns {Object
|
|
136
|
+
* Get site configuration
|
|
137
|
+
* @returns {Object} Site config object
|
|
72
138
|
*/
|
|
73
|
-
export function
|
|
139
|
+
export function getSiteConfig(): Object;
|
|
74
140
|
/**
|
|
75
|
-
* Get the
|
|
76
|
-
* @returns {Object|null}
|
|
141
|
+
* Get the latest post
|
|
142
|
+
* @returns {Object|null} Latest post or null
|
|
77
143
|
*/
|
|
78
|
-
export function
|
|
144
|
+
export function getLatestPost(): Object | null;
|
|
79
145
|
/**
|
|
80
|
-
* Get
|
|
81
|
-
* @
|
|
82
|
-
* @returns {Array} Array of gutter items with content and position info
|
|
146
|
+
* Get home page content
|
|
147
|
+
* @returns {Object|null} Home page data or null
|
|
83
148
|
*/
|
|
84
|
-
export function
|
|
149
|
+
export function getHomePage(): Object | null;
|
|
85
150
|
/**
|
|
86
|
-
* Get
|
|
87
|
-
* @param {string} slug - The
|
|
88
|
-
* @returns {Object|null}
|
|
151
|
+
* Get a post by its slug
|
|
152
|
+
* @param {string} slug - The post slug
|
|
153
|
+
* @returns {Object|null} Post object or null
|
|
89
154
|
*/
|
|
90
|
-
export function
|
|
155
|
+
export function getPostBySlug(slug: string): Object | null;
|
|
91
156
|
/**
|
|
92
|
-
* Get
|
|
93
|
-
* @
|
|
94
|
-
* @returns {Object|null} Recipe object with content and metadata
|
|
157
|
+
* Get about page content
|
|
158
|
+
* @returns {Object|null} About page data or null
|
|
95
159
|
*/
|
|
96
|
-
export function
|
|
160
|
+
export function getAboutPage(): Object | null;
|
|
97
161
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
162
|
+
* Get contact page content
|
|
163
|
+
* @returns {Object|null} Contact page data or null
|
|
100
164
|
*/
|
|
101
|
-
export function
|
|
165
|
+
export function getContactPage(): Object | null;
|