feat: implement barebone zola templates

This commit is contained in:
Alexander Navarro 2024-11-10 21:45:59 +00:00
parent 9c20f5ed2e
commit f99a9ae2ac
198 changed files with 2434 additions and 227991 deletions

View file

@ -0,0 +1,31 @@
---
import i18next from 'i18next';
import config from '../../astro-i18next.config.mjs';
export interface Props {
path: string;
}
const { path } = Astro.props;
const pages = await Astro.glob('../../public/locales/**/*.md');
let markdown;
markdown = pages.find((page) =>
page.file.includes(`locales/${i18next.language}/${path}`),
);
if (!markdown) {
markdown = pages.find((page) =>
page.file.includes(`locales/${config.defaultLocale}/${path}`),
);
}
if (!markdown) {
throw Error(`The file: "${path}" was not found.`);
}
const { Content } = markdown;
---
<Content />