update to astro V2

This commit is contained in:
Nico 2023-02-03 11:21:01 +01:00
parent 082b193d23
commit f24a432155
14 changed files with 789 additions and 796 deletions

View file

@ -12,7 +12,7 @@ export async function getStaticPaths() {
return data.lang === astroI18n.langCode;
});
return articles.map((article) => ({
params: { slug: article.data.slug },
params: { slug: article.slug },
props: { article },
}));
}

View file

@ -12,7 +12,7 @@ export async function getStaticPaths() {
return data.lang === astroI18n.langCode;
});
return snippets.map((snippet) => ({
params: { slug: snippet.data.slug },
params: { slug: snippet.slug },
props: { snippet },
}));
}

View file

@ -8,8 +8,8 @@
"latestProjects": "Latest projects",
"latestArticles": "Latest articles",
"allProjects": "All projects",
"allArticles": "All articles",
"allArticles": "Browse all articles",
"latestSnippets": "Latest snippets",
"allSnippets": "All snippets",
"allSnippets": "Browse all snippets",
"toc": "table of content"
}

View file

@ -8,8 +8,8 @@
"latestProjects": "Derniers projets",
"latestArticles": "Derniers articles",
"allProjects": "Tous les projets",
"allArticles": "Tous les articles",
"allArticles": "Consulter tous les articles",
"latestSnippets": "Derniers fragments",
"allSnippets": "Tous les fragments",
"allSnippets": "Consulter tous les fragments",
"toc": "table des matières"
}

View file

@ -75,16 +75,20 @@ const sortedSnippets = localizedSnippets.sort(
))
}
<section class="region latest">
<section class="region flow latest">
<div class="flow latest__articles">
<h2>{t("index.latestArticles")}</h2>
<ListCards list={sortedArticles} routeName={t("article.titre")} />
<p><a href={l("/articles")}>{t("index.allArticles")}</a></p>
<p class="latest__link">
<a href={l("/articles")}>{t("index.allArticles")}</a>
</p>
</div>
<div class="flow latest__snippets">
<h2>{t("index.latestSnippets")}</h2>
<ListCards list={sortedSnippets} routeName={t("fragments.titre")} />
<p><a href={l("/fragments")}>{t("index.allSnippets")}</a></p>
<p class="latest__link">
<a href={l("/fragments")}>{t("index.allSnippets")}</a>
</p>
</div>
</section>
</BaseLayout>
@ -163,6 +167,14 @@ const sortedSnippets = localizedSnippets.sort(
font-size: var(--size-1);
}
.latest {
--flow-space: var(--space-l-xl);
}
.latest__link {
text-align: end;
}
@container section (min-width: 50rem) {
.section__container {
flex-direction: row;

View file

@ -37,7 +37,7 @@ const pageTitle = t("sitemap");
{
localizedArticles.map((article) => (
<li>
<a href={l("/articles/[slug]", { slug: article.data.slug })}>
<a href={l("/articles/[slug]", { slug: article.slug })}>
{article.data.title}
</a>
</li>
@ -53,7 +53,7 @@ const pageTitle = t("sitemap");
{
localizedFragments.map((fragment) => (
<li>
<a href={l("/fragments/[slug]", { slug: fragment.data.slug })}>
<a href={l("/fragments/[slug]", { slug: fragment.slug })}>
{fragment.data.title}
</a>
</li>