Docs: 'hidden' blog posts (#19437)

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
This commit is contained in:
Kevin Lewis
2023-08-15 13:03:13 +02:00
committed by GitHub
parent 415e385fdb
commit 81e01460e8
2 changed files with 4 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ export default {
async load() {
const { data: articles } = await (
await fetch(
'https://marketing.directus.app/items/developer_articles?fields=*,author.first_name,author.last_name,author.avatar,author.title,tags.directus_tags_id.title,tags.directus_tags_id.slug,tags.directus_tags_id.type&sort=-date_published'
'https://marketing.directus.app/items/developer_articles?fields=*,author.first_name,author.last_name,author.avatar,author.title,tags.directus_tags_id.title,tags.directus_tags_id.slug,tags.directus_tags_id.type&filter[status][_eq]=published&sort=-date_published'
)
).json();
@@ -12,7 +12,7 @@ export default {
await fetch('https://marketing.directus.app/items/docs_tags?fields=*&sort=-count(developer_articles)')
).json();
let posts = articles.map((article) => ({
const posts = articles.map((article) => ({
id: article.slug,
title: article.title,
date_published: article.date_published,

View File

@@ -2,7 +2,7 @@ export default {
async paths() {
const response = await (
await fetch(
'https://marketing.directus.app/items/docs_tags?fields=*,developer_articles.developer_articles_id.title,developer_articles.developer_articles_id.date_published,developer_articles.developer_articles_id.slug,developer_articles.developer_articles_id.image,developer_articles.developer_articles_id.author.first_name,developer_articles.developer_articles_id.author.last_name,developer_articles.developer_articles_id.author.avatar,author.title'
'https://marketing.directus.app/items/docs_tags?fields=*,developer_articles.developer_articles_id.title,developer_articles.developer_articles_id.date_published,developer_articles.developer_articles_id.slug,developer_articles.developer_articles_id.image,developer_articles.developer_articles_id.author.first_name,developer_articles.developer_articles_id.author.last_name,developer_articles.developer_articles_id.author.avatar,author.title,developer_articles.developer_articles_id.status'
)
).json();
@@ -14,6 +14,7 @@ export default {
articles: tag.developer_articles
.map((article) => {
if (!article.developer_articles_id) return;
if (article.developer_articles_id.status !== 'published') return;
return {
title: article.developer_articles_id.title,