feat(Content): Add content for "about me" in en/es

This commit is contained in:
Alexander Navarro 2024-04-02 10:54:31 -03:00
parent 6300f045ff
commit b30d0e6864
12 changed files with 191 additions and 22 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 />