lot of content
This commit is contained in:
parent
9b91b02d90
commit
082b193d23
31 changed files with 338 additions and 70 deletions
|
@ -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(
|
||||
|
|
7
src/pages/en/sitemap.astro
Normal file
7
src/pages/en/sitemap.astro
Normal file
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
import Page from "../plan-du-site.astro"
|
||||
|
||||
const { props } = Astro
|
||||
---
|
||||
|
||||
<Page {...props} />
|
|
@ -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(
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"quoi": "I design <strong>websites</strong> and <strong>web applications</strong> following <a href='https://www.a11yproject.com/' title='A11y project’s 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",
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"title": "Création de <span class='highlight'>sites web</span> <a href='/articles/faq' clean-link>sobres et accessibles</a>",
|
||||
"title": "Création de <span class='highlight'>sites 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' >d’accessibilités</a>.",
|
||||
"comment": "Plus précisément, je crée des interfaces web et mobiles. De l’ergonomie jusqu’au design final, de l’intégration jusqu’à la mise en ligne. Je mets en avant les standards d’accessibilité numérique, pour lesquels j’ai 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 m’inscris également dans une démarche <a href='https://www.ademe.fr/expertises/consommer-autrement/passer-a-laction/ameliorer-pratiques/lecoconception' title='Définition de l’ADEME (nouvelle fenêtre)' rel='noopener noreferer'>d’éco-conception</a> des services que je propose.",
|
||||
"opensource": "J’essaie de contribuer à des <a href='https://git.nardu.in/explore/repos' title='Projets sur lesquels j’ai 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 ! Des articles sur le graphisme et l’informatique.",
|
||||
"writing": "Ah et j’écris <a href='/articles'>des articles</a> aussi ! Des articles sur le graphisme et l’informatique.",
|
||||
"latestProjects": "Derniers projets",
|
||||
"latestArticles": "Derniers articles",
|
||||
"allProjects": "Tous les projets",
|
||||
|
|
|
@ -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(
|
||||
|
|
82
src/pages/plan-du-site.astro
Normal file
82
src/pages/plan-du-site.astro
Normal 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>
|
Loading…
Add table
Add a link
Reference in a new issue