working i18n conf
This commit is contained in:
parent
15b825bd5d
commit
1ab35db47d
19 changed files with 479 additions and 369 deletions
|
@ -18,10 +18,12 @@ const { pageTitle, titleColor } = Astro.props;
|
|||
<title>{pageTitle} - Nicolas Arduin</title>
|
||||
</head>
|
||||
<body>
|
||||
<Header />
|
||||
<main id="skip-content" role="main">
|
||||
<slot/>
|
||||
</main>
|
||||
<div class="wrapper">
|
||||
<Header />
|
||||
<main id="skip-content" role="main">
|
||||
<slot/>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
<style define:vars={{ titleColor }}>
|
||||
h1 {
|
||||
|
|
|
@ -1,28 +1,42 @@
|
|||
---
|
||||
import { l, t, astroI18n } from "astro-i18n";
|
||||
import AstroImage from "../components/AstroImage.astro";
|
||||
import BaseLayout from "../layouts/BaseLayout.astro";
|
||||
|
||||
const { frontmatter, image, published, title } = Astro.props;
|
||||
const publishedDate = new Intl.DateTimeFormat("fr", {
|
||||
const currentLocale = astroI18n.langCode;
|
||||
|
||||
const { frontmatter, image, title } = Astro.props;
|
||||
const publishedDate = new Date(frontmatter.pubDate);
|
||||
const localizedDate = new Intl.DateTimeFormat(currentLocale, {
|
||||
dateStyle: "long",
|
||||
}).format(published);
|
||||
}).format(publishedDate);
|
||||
---
|
||||
|
||||
<BaseLayout pageTitle={title}>
|
||||
<p>Publié le : {frontmatter.pubDate.slice(0, 10)}</p>
|
||||
<time datetime={published}>
|
||||
{publishedDate}.
|
||||
</time>
|
||||
<p>
|
||||
Publié le : <time datetime={frontmatter.pubDate}>
|
||||
{localizedDate}.
|
||||
</time>
|
||||
</p>
|
||||
<p>
|
||||
{
|
||||
t("article.published", {
|
||||
datetime: frontmatter.pubDate,
|
||||
options: { dateStyle: "long" },
|
||||
})
|
||||
}
|
||||
</p>
|
||||
<div class="tags">
|
||||
{
|
||||
frontmatter.tags.map((tag) => (
|
||||
<p class="tag">
|
||||
<a href={`/tags/${tag}`}>{tag}</a>
|
||||
<a href={l(`/tags/${[tag]}`)}>{tag}</a>
|
||||
</p>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
<p>{frontmatter.description}</p>
|
||||
<pre></pre>
|
||||
<hr />
|
||||
{
|
||||
!!image && (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue