copilot/add-i18n-support-for-english
copilot/add-i18n-support-for-english
dependabot/npm_and_yarn/astro-5.16.4
dependabot/npm_and_yarn/katex-0.16.27
dependabot/npm_and_yarn/prettier-3.7.4
dependabot/npm_and_yarn/tailwindcss-4.1.16
dependabot/npm_and_yarn/tailwindcss/vite-4.1.16
dependabot/npm_and_yarn/typescript-eslint-8.46.2
dependabot/npm_and_yarn/typescript-eslint/parser-8.46.2
development
main
| 1 | --- |
| 2 | import { getEntry } from 'astro:content' |
| 3 | import { render } from 'astro:content' |
| 4 | import { getLangFromUrl } from '@/i18n/utils' |
| 5 | |
| 6 | const currentLang = getLangFromUrl(Astro.url) |
| 7 | const aboutId = currentLang === 'en' ? 'en/about' : 'about' |
| 8 | const aboutEntry = await getEntry('about', aboutId) |
| 9 | // Check if there is actual content (excluding comments) |
| 10 | const hasContent = aboutEntry?.body |
| 11 | ? aboutEntry.body.replace(/<!--[\s\S]*?-->/g, '').trim().length > 0 |
| 12 | : false |
| 13 | const { Content } = hasContent && aboutEntry ? await render(aboutEntry) : { Content: null } |
| 14 | --- |
| 15 | |
| 16 | { |
| 17 | hasContent && Content && ( |
| 18 | <div class="about prose"> |
| 19 | <Content /> |
| 20 | </div> |
| 21 | ) |
| 22 | } |
| 23 | |
| 24 | <style> |
| 25 | .about:not(:empty) { |
| 26 | margin-bottom: 1.25rem; |
| 27 | } |
| 28 | </style> |