better sitemap organization
This commit is contained in:
parent
b2b6887fdf
commit
65c6003313
@ -26,7 +26,7 @@
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"permalink": {
|
||||
"slug": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
@ -51,7 +51,7 @@
|
||||
"lang",
|
||||
"tags",
|
||||
"type",
|
||||
"permalink",
|
||||
"slug",
|
||||
"createdAt"
|
||||
],
|
||||
"additionalProperties": false
|
||||
|
@ -26,7 +26,7 @@
|
||||
"type": {
|
||||
"type": "string"
|
||||
},
|
||||
"permalink": {
|
||||
"slug": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
@ -51,7 +51,7 @@
|
||||
"lang",
|
||||
"tags",
|
||||
"type",
|
||||
"permalink",
|
||||
"slug",
|
||||
"createdAt"
|
||||
],
|
||||
"additionalProperties": false
|
||||
|
@ -20,7 +20,7 @@
|
||||
"en"
|
||||
]
|
||||
},
|
||||
"permalink": {
|
||||
"slug": {
|
||||
"type": "string"
|
||||
},
|
||||
"tags": {
|
||||
@ -50,7 +50,7 @@
|
||||
"subtitle",
|
||||
"url",
|
||||
"lang",
|
||||
"permalink",
|
||||
"slug",
|
||||
"tags",
|
||||
"createdAt"
|
||||
],
|
||||
|
@ -6,13 +6,9 @@ export default new Map([
|
||||
["src/content/articles/en/video-compression.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fvideo-compression.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/en/image-full.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Fen%2Fimage-full.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/en/super-cookies.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Fen%2Fsuper-cookies.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/image-full.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fimage-full.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/buttons.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fbuttons.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/fr/sci-hub-blocage.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Ffr%2Fsci-hub-blocage.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/super-cookies.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fsuper-cookies.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/buttons.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fbuttons.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/fragments/fr/image-full.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fimage-full.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/fr/the-day-I-jamd.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Ffr%2Fthe-day-I-jamd.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/en-after-effects-expressions.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fen-after-effects-expressions.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/en-sci-hub-blocage.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fen-sci-hub-blocage.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/en-the-day-I-jamd.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fen-the-day-I-jamd.mdx&astroContentModuleFlag=true")],
|
||||
["src/content/articles/en/en-video-compression.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Farticles%2Fen%2Fen-video-compression.mdx&astroContentModuleFlag=true")]]);
|
||||
["src/content/fragments/fr/super-cookies.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Ffragments%2Ffr%2Fsuper-cookies.mdx&astroContentModuleFlag=true")]]);
|
||||
|
File diff suppressed because one or more lines are too long
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,5 +1,6 @@
|
||||
# build output
|
||||
dist/
|
||||
.astro/
|
||||
|
||||
# dependencies
|
||||
node_modules/
|
||||
@ -18,5 +19,5 @@ pnpm-debug.log*
|
||||
# macOS-specific files
|
||||
.DS_Store
|
||||
|
||||
# i18n
|
||||
# astro
|
||||
astro_tmp_pages_*
|
@ -5,12 +5,18 @@ import BaseLayout from '../layouts/BaseLayout.astro'
|
||||
import { getCollection } from 'astro:content'
|
||||
|
||||
// get all articles
|
||||
const allArticles = await getCollection('articles', ({ data }) => {
|
||||
return !data.draft
|
||||
const frArticles = await getCollection('articles', ({ data }) => {
|
||||
return !data.draft && data.lang === 'fr'
|
||||
})
|
||||
const enArticles = await getCollection('articles', ({ data }) => {
|
||||
return !data.draft && data.lang === 'en'
|
||||
})
|
||||
// get all snippets
|
||||
const allFragments = await getCollection('fragments', ({ data }) => {
|
||||
return !data.draft
|
||||
const frFragments = await getCollection('fragments', ({ data }) => {
|
||||
return !data.draft && data.lang === 'fr'
|
||||
})
|
||||
const enFragments = await getCollection('fragments', ({ data }) => {
|
||||
return !data.draft && data.lang === 'en'
|
||||
})
|
||||
|
||||
const pageTitle = 'Plan du site'
|
||||
@ -29,36 +35,63 @@ const pageTitle = 'Plan du site'
|
||||
<h2>
|
||||
<a href='/articles'>Articles</a>
|
||||
</h2>
|
||||
<h3>Articles en français</h3>
|
||||
<ul>
|
||||
{
|
||||
allArticles.map((article) => (
|
||||
frArticles.map((article) => (
|
||||
<li>
|
||||
<a href={`/articles/${article.data.slug}`}>
|
||||
{article.data.title} <sup>({article.data.lang})</sup>
|
||||
{article.data.title}
|
||||
</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
<div lang='en'>
|
||||
<h3>Articles in english</h3>
|
||||
<ul>
|
||||
{
|
||||
enArticles.map((article) => (
|
||||
<li>
|
||||
<a href={`/articles/${article.data.slug}`}>
|
||||
{article.data.title}
|
||||
</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<h2>
|
||||
<a href='/fragments'>Fragments</a>
|
||||
</h2>
|
||||
<h3>Fragments en français</h3>
|
||||
<ul>
|
||||
{
|
||||
allFragments.map((fragment) => (
|
||||
frFragments.map((fragment) => (
|
||||
<li>
|
||||
<a
|
||||
href={`/fragments/${fragment.id}`}
|
||||
lang={fragment.data.lang !== 'fr' ? fragment.data.lang : null}
|
||||
>
|
||||
{fragment.data.title} <sup>({fragment.data.lang})</sup>
|
||||
<a href={`/fragments/${fragment.data.slug}`}>
|
||||
{fragment.data.title}
|
||||
</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
<div lang='en'>
|
||||
<h3>Snippets in english</h3>
|
||||
<ul>
|
||||
{
|
||||
enFragments.map((fragment) => (
|
||||
<li>
|
||||
<a href={`/fragments/${fragment.data.slug}`}>
|
||||
{fragment.data.title}
|
||||
</a>
|
||||
</li>
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<h2>
|
||||
|
Loading…
Reference in New Issue
Block a user