added references page + references

This commit is contained in:
Nico 2023-04-19 18:24:40 +02:00
parent eb410418be
commit 50fdae2308
23 changed files with 297 additions and 41 deletions

View file

@ -0,0 +1,9 @@
---
import Page from "../../travaux/[slug].astro"
export { getStaticPaths } from "../../travaux/[slug].astro"
const { props } = Astro
---
<Page {...props} />

View file

@ -0,0 +1,7 @@
---
import Page from "../../references/index.astro"
const { props } = Astro
---
<Page {...props} />

View file

@ -0,0 +1,4 @@
{
"pageName": "Work",
"subtitle": "Some fine websites right here."
}

View file

@ -0,0 +1,4 @@
{
"pageName": "Références",
"subtitle": "Des sites web de qualité."
}

View file

@ -0,0 +1,44 @@
---
import { l, t, astroI18n } from "astro-i18n";
astroI18n.init(Astro);
// New astro content collections
import { getCollection } from "astro:content";
import BaseLayout from "../../layouts/BaseLayout.astro";
import ListCards from "../../components/ListCards.astro";
const localizedPost = await getCollection("references", ({ data }) => {
return data.lang === astroI18n.langCode && !data.draft;
});
// sort references by descending publication date
const sortedReferences = localizedPost.sort(
(a, b) => b.data.createdAt - a.data.createdAt
);
const pageTitle = t("index.references.pageName");
---
<BaseLayout pageTitle={pageTitle}>
<section class="region flow">
<h1>{t("index.references.pageName")}</h1>
<h2>{t("index.references.subtitle")}</h2>
<ListCards list={sortedReferences} routeName={t("references.slug")} />
</section>
</BaseLayout>
<style>
.flow h2 + :global(*) {
margin-block-start: var(--space-m-l);
}
h1 {
text-transform: capitalize;
}
h1,
h2 {
padding-inline-start: var(--space-xs-s);
}
h2 {
color: var(--color-brique);
}
</style>