|
1 | 1 | <script lang="ts">
|
| 2 | + import { page } from '$app/state'; |
2 | 3 | import { Media } from '$lib/UI';
|
3 | 4 | import { FooterNav, MainFooter } from '$lib/components';
|
| 5 | + import CTA from '$lib/components/BlogCta.svelte'; |
| 6 | + import Article from '$lib/components/blog/article.svelte'; |
| 7 | + import Breadcrumbs from '$lib/components/blog/breadcrumbs.svelte'; |
| 8 | + import Newsletter from '$lib/components/blog/newsletter.svelte'; |
| 9 | + import PostMeta from '$lib/components/blog/post-meta.svelte'; |
| 10 | + import TableOfContents from '$lib/components/blog/table-of-contents.svelte'; |
4 | 11 | import { Main } from '$lib/layouts';
|
| 12 | + import type { TocItem } from '$lib/layouts/DocsArticle.svelte'; |
5 | 13 | import { formatDate } from '$lib/utils/date';
|
6 | 14 | import {
|
7 | 15 | createBreadcrumbsSchema,
|
|
12 | 20 | import type { AuthorData, PostsData } from '$routes/blog/content';
|
13 | 21 | import { TITLE_SUFFIX } from '$routes/titles';
|
14 | 22 | import { getContext, setContext } from 'svelte';
|
15 |
| - import { page } from '$app/state'; |
16 |
| - import CTA from '$lib/components/BlogCta.svelte'; |
17 |
| - import PostMeta from '$lib/components/blog/post-meta.svelte'; |
18 |
| - import Breadcrumbs from '$lib/components/blog/breadcrumbs.svelte'; |
19 |
| - import Newsletter from '$lib/components/blog/newsletter.svelte'; |
20 |
| - import TableOfContents from '$lib/components/blog/table-of-contents.svelte'; |
21 |
| - import Article from '$lib/components/blog/article.svelte'; |
22 |
| - import type { TocItem } from '$lib/layouts/DocsArticle.svelte'; |
23 | 23 | import { writable } from 'svelte/store';
|
24 | 24 | import type { LayoutContext } from './Article.svelte';
|
25 | 25 |
|
|
39 | 39 | | boolean;
|
40 | 40 | export let lastUpdated: string;
|
41 | 41 |
|
42 |
| - const posts = getContext<PostsData[]>('posts'); |
| 42 | + const posts = getContext<PostsData[]>('posts')?.filter( |
| 43 | + (post) => !(post.unlisted ?? false) && !(post.draft ?? false) |
| 44 | + ); |
43 | 45 | const authors = getContext<AuthorData[]>('authors');
|
44 | 46 | const authorData = authors.find((a) => a.slug === author);
|
45 | 47 |
|
|
0 commit comments