lot of content

This commit is contained in:
Nico 2023-02-03 10:37:28 +01:00
parent 9b91b02d90
commit 082b193d23
31 changed files with 338 additions and 70 deletions

View file

@ -9,7 +9,7 @@ import BaseLayout from "../../layouts/BaseLayout.astro";
import ListCards from "../../components/ListCards.astro";
const localizedPost = await getCollection("articles", ({ data }) => {
return data.lang === astroI18n.langCode;
return data.lang === astroI18n.langCode && !data.draft;
});
// sort articles by descending publication date
const sortedArticles = localizedPost.sort(

View file

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

View file

@ -9,7 +9,7 @@ import BaseLayout from "../../layouts/BaseLayout.astro";
import ListCards from "../../components/ListCards.astro";
const localizedPost = await getCollection("fragments", ({ data }) => {
return data.lang === astroI18n.langCode;
return data.lang === astroI18n.langCode && !data.draft;
});
// sort snippets by descending publication date
const sortedPosts = localizedPost.sort(

View file

@ -4,7 +4,7 @@
"quoi": "I design <strong>websites</strong> and <strong>web applications</strong> following <a href='https://www.a11yproject.com/' title='A11y projects website (new window)' target='_blank' rel='noreferer noopener' >accessibility</a> best practices.",
"comment": "More precisely, I create web and mobile interfaces. From UX to UI, from development to deployment. I put digital accessibility standards, for which I have obtained the <a href='https://directory.opquast.com/fr/certificat/CTQSKP/' title='My Opquast certificate (new window)' target='_blank' rel='noreferer noopener'>Opquast certification</a>, forwards. I also keep <a href='https://en.wikipedia.org/wiki/Ecological_design' title='eco-design definition (new window)' target='_blank' rel='noreferer noopener'>eco-design</a> in mind when working.",
"opensource": "I try to contribute to <a class='u-nice-links' href='https://git.nardu.in/explore/repos' title='Open source projects I worked on (new window)' target='_blank' rel='noreferer noopener'>open source projects</a> that I enjoy.",
"writing": "Oh and I write <a class='u-nice-links' href='/en/articles/'>articles!</a> Articles about design and the web in general.",
"writing": "Oh and I write <a class='u-nice-links' href='/en/articles'>articles!</a> Articles about design and the web in general.",
"latestProjects": "Latest projects",
"latestArticles": "Latest articles",
"allProjects": "All projects",

View file

@ -1,10 +1,10 @@
{
"title": "Création de <span class='highlight'>sites&nbsp;web</span> <a href='/articles/faq' clean-link>sobres et accessibles</a>",
"title": "Création de <span class='highlight'>sites&nbsp;web</span> <a href='/articlesfaq' clean-link>sobres et accessibles</a>",
"subtitle": "Apprenez-en plus sur…",
"quoi": "Je crée des <strong>sites</strong> et des <strong>applications web</strong> en suivant les bonnes pratiques <a href='https://access42.net/decouvrir-accessibilite' title='Définition selon Access42 (nouvelle fenêtre)' target='_blank' rel='noreferer noopener' >daccessibilités</a>.",
"comment": "Plus précisément, je crée des interfaces web et mobiles. De lergonomie jusquau design final, de lintégration jusquà la mise en ligne. Je mets en avant les standards daccessibilité numérique, pour lesquels jai obtenu la <a href='https://directory.opquast.com/fr/certificat/CTQSKP/' title='Certificat Opquast personnel (nouvelle fenêtre)' target='_blank' rel='noreferer noopener'>certification Opquast</a>. Je minscris également dans une démarche <a href='https://www.ademe.fr/expertises/consommer-autrement/passer-a-laction/ameliorer-pratiques/lecoconception' title='Définition de lADEME (nouvelle fenêtre)' rel='noopener noreferer'>déco-conception</a> des services que je propose.",
"opensource": "Jessaie de contribuer à des <a href='https://git.nardu.in/explore/repos' title='Projets sur lesquels jai travaillé (nouvelle fenêtre)' target='_blank' rel='noreferer noopener'>projets open source</a> qui me tiennent à cœur.",
"writing": "Ah et jécris <a href='/articles/'>des articles</a> aussi&nbsp;! Des articles sur le graphisme et linformatique.",
"writing": "Ah et jécris <a href='/articles'>des articles</a> aussi&nbsp;! Des articles sur le graphisme et linformatique.",
"latestProjects": "Derniers projets",
"latestArticles": "Derniers articles",
"allProjects": "Tous les projets",

View file

@ -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(

View file

@ -0,0 +1,82 @@
---
// init i18n
import { l, t, astroI18n } from "astro-i18n";
astroI18n.init(Astro);
import BaseLayout from "../layouts/BaseLayout.astro";
// New astro content collections
import { getCollection } from "astro:content";
// get all articles
const localizedArticles = await getCollection("articles", ({ data }) => {
return data.lang === astroI18n.langCode && !data.draft;
});
// get all snippets
const localizedFragments = await getCollection("fragments", ({ data }) => {
return data.lang === astroI18n.langCode && !data.draft;
});
const pageTitle = t("sitemap");
---
<BaseLayout pageTitle={pageTitle}>
<section class="region">
<h1>{t("sitemap")}</h1>
<ul class="flow sitemap" role="list">
<li>
<h2>
<a href={l("/")}>{t("accueil")}</a>
</h2>
</li>
<li>
<h2>
<a href={l("/articles")}>{t("article.titre")}</a>
</h2>
<ul>
{
localizedArticles.map((article) => (
<li>
<a href={l("/articles/[slug]", { slug: article.data.slug })}>
{article.data.title}
</a>
</li>
))
}
</ul>
</li>
<li>
<h2>
<a href={l("/fragments")}>{t("fragments.titre")}</a>
</h2>
<ul>
{
localizedFragments.map((fragment) => (
<li>
<a href={l("/fragments/[slug]", { slug: fragment.data.slug })}>
{fragment.data.title}
</a>
</li>
))
}
</ul>
</li>
</ul>
</section>
</BaseLayout>
<style>
/* :link {
text-decoration: underline;
}
:link:hover {
text-decoration: none;
} */
h2 {
text-transform: capitalize;
}
.sitemap * + * {
margin-block-start: 20px;
}
</style>