lot of content
This commit is contained in:
parent
9b91b02d90
commit
082b193d23
31 changed files with 338 additions and 70 deletions
|
@ -21,7 +21,7 @@ const localizedSections = allSections.filter((section) => {
|
|||
import { getCollection } from "astro:content";
|
||||
// Only return posts with correct lang in the frontmatter
|
||||
const localizedArticles = await getCollection("articles", ({ data }) => {
|
||||
return data.lang === astroI18n.langCode;
|
||||
return data.lang === astroI18n.langCode && !data.draft;
|
||||
});
|
||||
// sort articles by descending publication date
|
||||
const sortedArticles = localizedArticles.sort(
|
||||
|
@ -29,7 +29,7 @@ const sortedArticles = localizedArticles.sort(
|
|||
);
|
||||
// Only return snippets with correct lang in the frontmatter
|
||||
const localizedSnippets = await getCollection("fragments", ({ data }) => {
|
||||
return data.lang === astroI18n.langCode;
|
||||
return data.lang === astroI18n.langCode && !data.draft;
|
||||
});
|
||||
// sort articles by descending publication date
|
||||
const sortedSnippets = localizedSnippets.sort(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue