cleanup and refactor i18n + code

This commit is contained in:
nico 2024-12-29 23:54:33 +01:00
parent 65c6003313
commit 703d1d7f08
Signed by: Nicolas
SSH key fingerprint: SHA256:ELi8eDeNLl5PTn64G+o2Kx5+XVDfHF5um2tZigfwWkM
28 changed files with 206 additions and 553 deletions

View file

@ -10,8 +10,6 @@ const { Content, headings } = await render(content)
const toc = headings.map((heading) => {
return heading
})
import '../styles/vendor/one-dark-pro.css'
---
<div class='sidebar region'>

View file

@ -1,6 +1,12 @@
---
import type { ArticleFrontmatter, FragmentFrontmatter } from '../content.config'
type Props = {
item: ArticleFrontmatter | FragmentFrontmatter
}
const { item } = Astro.props
const locale: 'fr' | 'en' = item.frontmatter.lang
const locale: 'fr' | 'en' = item.lang
let ui = {
published: 'Publié le',
@ -43,9 +49,9 @@ function rawDate(date: Date) {
)
}
{
formatDate(item.createdAt) != formatDate(item.updatedAt) &&
!!item.createdAt &&
!!item.updatedAt && (
!!item.createdAt &&
!!item.updatedAt &&
formatDate(item.createdAt) != formatDate(item.updatedAt) && (
<p class='meta__date'>
{ui.updated}&nbsp;:
<time datetime={rawDate(item.updatedAt)}>