@functionalcms/svelte-components 2.15.1 → 2.16.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.
|
@@ -11,3 +11,20 @@ export async function listAllPosts(page = 0, postCount = MAX_POSTS) {
|
|
|
11
11
|
publishedPosts.sort((a, b) => (new Date(a.date) > new Date(b.date) ? -1 : 1));
|
|
12
12
|
return { posts: publishedPosts };
|
|
13
13
|
}
|
|
14
|
+
export async function importPost({ params }) { }
|
|
15
|
+
{
|
|
16
|
+
const modules = import.meta.glob(`/src/posts/*.{md,svx,svelte.md}`);
|
|
17
|
+
let match = {};
|
|
18
|
+
for (const [path, resolver] of Object.entries(modules)) {
|
|
19
|
+
if (slugFromPath(path) === params.slug) {
|
|
20
|
+
match = { path, resolver: resolver };
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const post = await match?.resolver?.();
|
|
25
|
+
return {
|
|
26
|
+
component: post.default,
|
|
27
|
+
frontmatter: post.metadata
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
;
|
package/dist/index.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { CaruseleItem } from './components/presentation/Carusele.js';
|
|
|
17
17
|
import BlogDescription from './components/blog/BlogDescription.svelte';
|
|
18
18
|
import BlogTitle from './components/blog/BlogTitle.svelte';
|
|
19
19
|
import type { BlogPost } from './components/blog/BlogPost.js';
|
|
20
|
-
import { listAllPosts } from './components/blog/blog.js';
|
|
20
|
+
import { importPost, listAllPosts } from './components/blog/blog.js';
|
|
21
21
|
import { convertShowItemsToNavigationItems } from './components/converters/ShowItemToNavigationItems.js';
|
|
22
22
|
import { ShowItem } from './components/presentation/ShowItem.js';
|
|
23
23
|
import { title, suffix } from './stores/title.js';
|
|
@@ -25,5 +25,5 @@ import { pages } from './stores/pages.js';
|
|
|
25
25
|
import { metaDescription, metaKeywords } from './stores/meta.js';
|
|
26
26
|
import { Justify, Placement, Orientation, Position, Sizes, AlignItmes } from './components/Styling.js';
|
|
27
27
|
import { Alert, Avatar, AvatarGroup, Breadcrumb, Button, ButtonGroup, Card, ChoiceInput, Close, Dialog, Disclose, Divider, Drawer, EmptyState, Header, HeaderNav, HeaderNavItem, Icon, IconSvg, Input, InputAddonItem, Loader, Pagination, Progress, Select, Spinner, Switch, Table, Tabs, Tag, Toast, Toasts } from 'agnostic-svelte';
|
|
28
|
-
export { Visiblity, HeaderNavigationItem, DynamicMenu, FlatMenu, ColumnMenu, HamburgerMenu, BlogTitle, BlogDescription, listAllPosts, DefaultLayout, TwoColumnsLayout, Banner, Link, Logo, SimpleFooter, Gallery, Carusel, CaruseleItem, Spacer, Well, Justify, Placement, Orientation, AlignItmes, Position, Sizes, ShowItem, convertShowItemsToNavigationItems, title, suffix, pages, metaDescription, metaKeywords, Alert, Avatar, AvatarGroup, Breadcrumb, Button, ButtonGroup, Card, ChoiceInput, Close, Dialog, Disclose, Divider, Drawer, EmptyState, Header, HeaderNav, HeaderNavItem, Icon, IconSvg, Input, InputAddonItem, Loader, Pagination, Progress, Select, Spinner, Switch, Table, Tabs, Tag, Toast, Toasts };
|
|
28
|
+
export { Visiblity, HeaderNavigationItem, DynamicMenu, FlatMenu, ColumnMenu, HamburgerMenu, BlogTitle, BlogDescription, listAllPosts, importPost, DefaultLayout, TwoColumnsLayout, Banner, Link, Logo, SimpleFooter, Gallery, Carusel, CaruseleItem, Spacer, Well, Justify, Placement, Orientation, AlignItmes, Position, Sizes, ShowItem, convertShowItemsToNavigationItems, title, suffix, pages, metaDescription, metaKeywords, Alert, Avatar, AvatarGroup, Breadcrumb, Button, ButtonGroup, Card, ChoiceInput, Close, Dialog, Disclose, Divider, Drawer, EmptyState, Header, HeaderNav, HeaderNavItem, Icon, IconSvg, Input, InputAddonItem, Loader, Pagination, Progress, Select, Spinner, Switch, Table, Tabs, Tag, Toast, Toasts };
|
|
29
29
|
export type { BlogPost };
|
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import Carusel from './components/presentation/Carusel.svelte';
|
|
|
16
16
|
import { CaruseleItem } from './components/presentation/Carusele.js';
|
|
17
17
|
import BlogDescription from './components/blog/BlogDescription.svelte';
|
|
18
18
|
import BlogTitle from './components/blog/BlogTitle.svelte';
|
|
19
|
-
import { listAllPosts } from './components/blog/blog.js';
|
|
19
|
+
import { importPost, listAllPosts } from './components/blog/blog.js';
|
|
20
20
|
import { convertShowItemsToNavigationItems } from './components/converters/ShowItemToNavigationItems.js';
|
|
21
21
|
import { ShowItem } from './components/presentation/ShowItem.js';
|
|
22
22
|
import { title, suffix } from './stores/title.js';
|
|
@@ -24,4 +24,4 @@ import { pages } from './stores/pages.js';
|
|
|
24
24
|
import { metaDescription, metaKeywords } from './stores/meta.js';
|
|
25
25
|
import { Justify, Placement, Orientation, Position, Sizes, AlignItmes } from './components/Styling.js';
|
|
26
26
|
import { Alert, Avatar, AvatarGroup, Breadcrumb, Button, ButtonGroup, Card, ChoiceInput, Close, Dialog, Disclose, Divider, Drawer, EmptyState, Header, HeaderNav, HeaderNavItem, Icon, IconSvg, Input, InputAddonItem, Loader, Pagination, Progress, Select, Spinner, Switch, Table, Tabs, Tag, Toast, Toasts } from 'agnostic-svelte';
|
|
27
|
-
export { Visiblity, HeaderNavigationItem, DynamicMenu, FlatMenu, ColumnMenu, HamburgerMenu, BlogTitle, BlogDescription, listAllPosts, DefaultLayout, TwoColumnsLayout, Banner, Link, Logo, SimpleFooter, Gallery, Carusel, CaruseleItem, Spacer, Well, Justify, Placement, Orientation, AlignItmes, Position, Sizes, ShowItem, convertShowItemsToNavigationItems, title, suffix, pages, metaDescription, metaKeywords, Alert, Avatar, AvatarGroup, Breadcrumb, Button, ButtonGroup, Card, ChoiceInput, Close, Dialog, Disclose, Divider, Drawer, EmptyState, Header, HeaderNav, HeaderNavItem, Icon, IconSvg, Input, InputAddonItem, Loader, Pagination, Progress, Select, Spinner, Switch, Table, Tabs, Tag, Toast, Toasts };
|
|
27
|
+
export { Visiblity, HeaderNavigationItem, DynamicMenu, FlatMenu, ColumnMenu, HamburgerMenu, BlogTitle, BlogDescription, listAllPosts, importPost, DefaultLayout, TwoColumnsLayout, Banner, Link, Logo, SimpleFooter, Gallery, Carusel, CaruseleItem, Spacer, Well, Justify, Placement, Orientation, AlignItmes, Position, Sizes, ShowItem, convertShowItemsToNavigationItems, title, suffix, pages, metaDescription, metaKeywords, Alert, Avatar, AvatarGroup, Breadcrumb, Button, ButtonGroup, Card, ChoiceInput, Close, Dialog, Disclose, Divider, Drawer, EmptyState, Header, HeaderNav, HeaderNavItem, Icon, IconSvg, Input, InputAddonItem, Loader, Pagination, Progress, Select, Spinner, Switch, Table, Tabs, Tag, Toast, Toasts };
|