moved computer

This commit is contained in:
nico 2024-06-21 15:05:35 +02:00
parent 5927336ae8
commit 59687fbade
154 changed files with 60 additions and 4207 deletions

27
src/pages/articles/[slug].astro Normal file → Executable file
View file

@ -6,22 +6,29 @@ import { getCollection } from "astro:content";
import EditorialContent from "../../components/EditorialContent.astro";
import BaseLayout from "../../layouts/BaseLayout.astro";
export const getStaticPaths = createStaticPaths(async ({ langCode }) => {
const articles = await getCollection("articles", ({ data }) => {
return data.lang === langCode;
});
return articles.map((article) => ({
params: { slug: article.data.permalink },
props: { article },
}));
}, import.meta.url);
export const getStaticPaths = createStaticPaths(
async ({ langCode }) => {
const articles = await getCollection("articles", ({ data }) => {
console.log(langCode);
return data.lang === langCode;
});
return articles.map((article) => ({
params: { slug: article.data.permalink },
props: { article },
}));
},
import.meta.url
);
// export async function getStaticPaths() {
// const articles = await getCollection("articles", ({ data }) => {
// console.log(astroI18n.langCode);
// return data.lang === astroI18n.langCode;
// });
// console.log(articles);
// return articles.map((article) => ({
// params: { slug: article.slug },
// params: { slug: article.data.permalink },
// props: { article },
// }));
// }

0
src/pages/articles/i18n/en.json Normal file → Executable file
View file

0
src/pages/articles/i18n/fr.json Normal file → Executable file
View file

0
src/pages/articles/index.astro Normal file → Executable file
View file

0
src/pages/en/articles/[slug].astro Normal file → Executable file
View file

0
src/pages/en/articles/index.astro Normal file → Executable file
View file

0
src/pages/en/index.astro Normal file → Executable file
View file

View file

@ -1,34 +0,0 @@
import rss from "@astrojs/rss";
import { getCollection } from "astro:content";
export async function get(context) {
const articles = await getCollection("articles", ({ data }) => {
return data.lang === "en" && !data.draft;
});
const fragments = await getCollection("fragments", ({ data }) => {
return data.lang === "en" && !data.draft;
});
const posts = articles.concat(fragments);
return rss({
// `<title>` field in output xml
title: "Nicolas Arduin",
// `<description>` field in output xml
description: "Articles from nardu.in",
// Pull in your project "site" from the endpoint context
// https://docs.astro.build/en/reference/api-reference/#contextsite
site: context.site,
// Array of `<item>`s in output xml
// See "Generating items" section for examples using content collections and glob imports
items: posts.map((post) => ({
title: post.data.title,
pubDate: post.data.createdAt,
description: post.data.subtitle,
lang: post.data.lang,
// Compute RSS link from post `slug`
// This example assumes all posts are rendered as `/blog/[slug]` routes
link: `/en/${post.data.type}/${post.data.permalink}/`,
})),
// (optional) inject custom xml
customData: `<language>en-us</language>`,
});
}

0
src/pages/en/sitemap.astro Normal file → Executable file
View file

0
src/pages/en/snippets/[slug].astro Normal file → Executable file
View file

0
src/pages/en/snippets/index.astro Normal file → Executable file
View file

0
src/pages/en/veille/index.astro Normal file → Executable file
View file

0
src/pages/en/work/index.astro Normal file → Executable file
View file

24
src/pages/fragments/[slug].astro Normal file → Executable file
View file

@ -1,27 +1,31 @@
---
import { createStaticPaths } from "astro-i18n";
// import { astroI18n } from "astro-i18n";
import { getCollection } from "astro:content";
import EditorialContent from "../../components/EditorialContent.astro";
import BaseLayout from "../../layouts/BaseLayout.astro";
export const getStaticPaths = createStaticPaths(async ({ langCode }) => {
const snippets = await getCollection("fragments", ({ data }) => {
return data.lang === langCode;
});
return snippets.map((snippet) => ({
params: { slug: snippet.data.permalink },
props: { snippet },
}));
}, import.meta.url);
export const getStaticPaths = createStaticPaths(
async ({ langCode }) => {
const snippets = await getCollection("fragments", ({ data }) => {
return data.lang === langCode;
});
return snippets.map((snippet) => ({
params: { slug: snippet.data.permalink },
props: { snippet },
}));
},
import.meta.url
);
// export async function getStaticPaths() {
// const snippets = await getCollection("fragments", ({ data }) => {
// return data.lang === astroI18n.langCode;
// });
// return snippets.map((snippet) => ({
// params: { slug: snippet.slug },
// params: { slug: snippet.data.permalink },
// props: { snippet },
// }));
// }

0
src/pages/fragments/i18n/en.json Normal file → Executable file
View file

0
src/pages/fragments/i18n/fr.json Normal file → Executable file
View file

0
src/pages/fragments/index.astro Normal file → Executable file
View file

0
src/pages/i18n/en.json Normal file → Executable file
View file

0
src/pages/i18n/fr.json Normal file → Executable file
View file

0
src/pages/index.astro Normal file → Executable file
View file

0
src/pages/plan-du-site.astro Normal file → Executable file
View file

0
src/pages/references/i18n/en.json Normal file → Executable file
View file

0
src/pages/references/i18n/fr.json Normal file → Executable file
View file

0
src/pages/references/index.astro Normal file → Executable file
View file

0
src/pages/rss.xml.js Normal file → Executable file
View file

0
src/pages/veille/i18n/en.json Normal file → Executable file
View file

0
src/pages/veille/i18n/fr.json Normal file → Executable file
View file

0
src/pages/veille/index.astro Normal file → Executable file
View file