added references page + references
This commit is contained in:
parent
eb410418be
commit
50fdae2308
23 changed files with 297 additions and 41 deletions
9
src/pages/en/work/[slug].astro
Normal file
9
src/pages/en/work/[slug].astro
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
import Page from "../../travaux/[slug].astro"
|
||||
|
||||
export { getStaticPaths } from "../../travaux/[slug].astro"
|
||||
|
||||
const { props } = Astro
|
||||
---
|
||||
|
||||
<Page {...props} />
|
7
src/pages/en/work/index.astro
Normal file
7
src/pages/en/work/index.astro
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
import Page from "../../references/index.astro"
|
||||
|
||||
const { props } = Astro
|
||||
---
|
||||
|
||||
<Page {...props} />
|
4
src/pages/references/i18n/en.json
Normal file
4
src/pages/references/i18n/en.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"pageName": "Work",
|
||||
"subtitle": "Some fine websites right here."
|
||||
}
|
4
src/pages/references/i18n/fr.json
Normal file
4
src/pages/references/i18n/fr.json
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"pageName": "Références",
|
||||
"subtitle": "Des sites web de qualité."
|
||||
}
|
44
src/pages/references/index.astro
Normal file
44
src/pages/references/index.astro
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue