--- import { getLanguageFromURL } from "@i18n/utils"; import * as utils from "@utils/index"; import ArticleItem from "@components/ArticleItem"; import EmptyList from "@components/EmptyList.astro"; import UIString from "@components/UIString.astro"; import TranslatedLink from "@components/TranslatedLink.astro"; import { getRecentArticleList, getSiteSettings } from "../queries"; const pageLang = getLanguageFromURL(Astro.url.pathname); const siteSettings = await getSiteSettings(); const articles = await getRecentArticleList(siteSettings?.recent_articles_limit || 5); const filteredArticles = utils.filterArticlesByPageLang(articles, pageLang); const isEmpty = articles.length === 0; --- { !isEmpty && !!filteredArticles ? ( filteredArticles.map( (a) => a && ( ) ) ) : ( ) }