i18n start + css start

This commit is contained in:
Nico 2022-12-02 17:29:11 +01:00
parent 688d794dc7
commit 15b825bd5d
40 changed files with 1062 additions and 33 deletions

View file

@ -0,0 +1,7 @@
{
"{route}": "blog",
"pageName": "Blog",
"pageName{cool:'yes'}": "Blog cools",
"pageName{cool:'no'}": "Blog nuls",
"trad": "hello english"
}

View file

@ -0,0 +1,6 @@
{
"pageName": "Articles",
"pageName{cool:'yes'}": "Articles cools",
"pageName{cool:'no'}": "Articles nuls",
"trad": "slt sava"
}

View file

@ -1,4 +1,6 @@
---
import { t, l } from "astro-i18n";
import "../../styles/style.css";
import BaseLayout from "../../layouts/BaseLayout.astro";
@ -6,11 +8,15 @@ import ContentPost from "../../components/ContentPost.astro";
const allPosts = await Astro.glob("./*.mdx");
const pageTitle = "Articles";
console.log(t("index.articles.pageName", { cool: "yes" }));
const pageTitle = t("index.articles.pageName");
const titleColor = "hotpink";
---
<BaseLayout pageTitle={pageTitle} titleColor={titleColor}>
<h2>{t("index.articles.pageName", { cool: "yes" }, "fr")}</h2>
<p>{t("index.articles.trad")}</p>
<ul>
{
allPosts.map((post) => (

View file

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

7
src/pages/en/index.astro Normal file
View file

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

View file

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

View file

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

9
src/pages/i18n/en.json Normal file
View file

@ -0,0 +1,9 @@
{
"title": "Crafting <a href='#methodology' clean-link>sober and accessible</a> <span class='highlight'>websites</span>",
"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.",
"articles": "Oh and I write <a class='u-nice-links' href='/en/articles/'>articles!</a> Articles about design and the web in general.",
"projetsRecents": "Latest projects",
"articlesRecents": "Latest articles"
}

9
src/pages/i18n/fr.json Normal file
View file

@ -0,0 +1,9 @@
{
"title": "Création de <span class='highlight'>sites&nbsp;web</span> <a href='/articles/faq' clean-link>sobres et accessibles</a>",
"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.",
"articles": "Ah et jécris <a href='/articles/'>des articles</a> aussi&nbsp;! Des articles sur le graphisme et linformatique.",
"projetsRecents": "Derniers projets",
"articlesRecents": "Derniers articles"
}

View file

@ -1,9 +1,10 @@
---
import BaseLayout from '../layouts/BaseLayout.astro';
import { t, l } from "astro-i18n";
import BaseLayout from "../layouts/BaseLayout.astro";
const pageTitle = "Accueil"
const pageTitle = t("accueil");
---
<BaseLayout pageTitle={pageTitle}>
<h2>devvvvv</h2>
<h1 set:html={t("index.title")}></h1>
</BaseLayout>