support published value
This commit is contained in:
@@ -7,6 +7,7 @@ import BlogCard from '@components/blog/BlogCard.astro';
|
|||||||
|
|
||||||
const posts = await directus.request(
|
const posts = await directus.request(
|
||||||
readItems('posts', {
|
readItems('posts', {
|
||||||
|
filter: { published: { _eq: true } },
|
||||||
fields: ['*'],
|
fields: ['*'],
|
||||||
sort: ['-published_date'],
|
sort: ['-published_date'],
|
||||||
})
|
})
|
||||||
|
@@ -25,6 +25,7 @@ export type Post = {
|
|||||||
tags: string[];
|
tags: string[];
|
||||||
category: string;
|
category: string;
|
||||||
selected: boolean;
|
selected: boolean;
|
||||||
|
published: boolean;
|
||||||
content: string;
|
content: string;
|
||||||
image: string;
|
image: string;
|
||||||
image_alt: string;
|
image_alt: string;
|
||||||
|
@@ -13,6 +13,7 @@ import blogImg from '@images/autumn_tree.png';
|
|||||||
const global = await directus.request(readSingleton('site_global'));
|
const global = await directus.request(readSingleton('site_global'));
|
||||||
const posts = await directus.request(
|
const posts = await directus.request(
|
||||||
readItems('posts', {
|
readItems('posts', {
|
||||||
|
filter: { status: { _eq: true } },
|
||||||
fields: ['*'],
|
fields: ['*'],
|
||||||
sort: ['-published_date'],
|
sort: ['-published_date'],
|
||||||
})
|
})
|
||||||
|
@@ -21,6 +21,7 @@ const { category } = Astro.props;
|
|||||||
const global = await directus.request(readSingleton('site_global'));
|
const global = await directus.request(readSingleton('site_global'));
|
||||||
const posts = await directus.request(
|
const posts = await directus.request(
|
||||||
readItems('posts', {
|
readItems('posts', {
|
||||||
|
filter: { published: { _eq: true } },
|
||||||
fields: ['*'],
|
fields: ['*'],
|
||||||
sort: ['-published_date'],
|
sort: ['-published_date'],
|
||||||
})
|
})
|
||||||
|
@@ -14,6 +14,7 @@ import categoryImg from '@images/autumn_bench.png';
|
|||||||
const global = await directus.request(readSingleton('site_global'));
|
const global = await directus.request(readSingleton('site_global'));
|
||||||
const posts = await directus.request(
|
const posts = await directus.request(
|
||||||
readItems('posts', {
|
readItems('posts', {
|
||||||
|
filter: { published: { _eq: true } },
|
||||||
fields: ['*'],
|
fields: ['*'],
|
||||||
sort: ['-published_date'],
|
sort: ['-published_date'],
|
||||||
})
|
})
|
||||||
|
@@ -23,6 +23,7 @@ export async function GET(context: APIContext) {
|
|||||||
// Load the content collection entries to add to our RSS feed.
|
// Load the content collection entries to add to our RSS feed.
|
||||||
const posts = await directus.request(
|
const posts = await directus.request(
|
||||||
readItems('posts', {
|
readItems('posts', {
|
||||||
|
filter: { published: { _eq: true } },
|
||||||
fields: ['*'],
|
fields: ['*'],
|
||||||
sort: ['-published_date'],
|
sort: ['-published_date'],
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user