mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Docs: 'hidden' blog posts (#19437)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user