i18n updates + HP + components
This commit is contained in:
parent
1ab35db47d
commit
23c79e579c
67 changed files with 1355 additions and 542 deletions
|
@ -1,15 +1,15 @@
|
|||
---
|
||||
import { astroI18n } from "astro-i18n";
|
||||
import { I18nProvider } from "astro-i18n/components"
|
||||
import '../styles/style.css';
|
||||
astroI18n.init(Astro);
|
||||
|
||||
import Header from '../components/Header.astro';
|
||||
import "../styles/style.css";
|
||||
|
||||
const currentLocale = astroI18n.langCode;
|
||||
const { pageTitle, titleColor } = Astro.props;
|
||||
import Header from "../components/Header.astro";
|
||||
|
||||
const { pageTitle, titleColor, lang } = Astro.props;
|
||||
---
|
||||
<I18nProvider>
|
||||
<html lang={currentLocale} dir="ltr">
|
||||
|
||||
<html lang={astroI18n.langCode} dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||
|
@ -21,14 +21,13 @@ const { pageTitle, titleColor } = Astro.props;
|
|||
<div class="wrapper">
|
||||
<Header />
|
||||
<main id="skip-content" role="main">
|
||||
<slot/>
|
||||
<slot />
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
<style define:vars={{ titleColor }}>
|
||||
h1 {
|
||||
color: var(--titleColor);
|
||||
color: var(--titleColor);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
</html>
|
||||
</I18nProvider>
|
|
@ -1,13 +1,11 @@
|
|||
---
|
||||
import { l, t, astroI18n } from "astro-i18n";
|
||||
import AstroImage from "../components/AstroImage.astro";
|
||||
// import AstroImage from "../components/AstroImage.astro";
|
||||
import BaseLayout from "../layouts/BaseLayout.astro";
|
||||
|
||||
const currentLocale = astroI18n.langCode;
|
||||
|
||||
const { frontmatter, image, title } = Astro.props;
|
||||
const publishedDate = new Date(frontmatter.pubDate);
|
||||
const localizedDate = new Intl.DateTimeFormat(currentLocale, {
|
||||
const localizedDate = new Intl.DateTimeFormat(astroI18n.langCode, {
|
||||
dateStyle: "long",
|
||||
}).format(publishedDate);
|
||||
---
|
||||
|
@ -38,7 +36,7 @@ const localizedDate = new Intl.DateTimeFormat(currentLocale, {
|
|||
<p>{frontmatter.description}</p>
|
||||
<pre></pre>
|
||||
<hr />
|
||||
{
|
||||
<!-- {
|
||||
!!image && (
|
||||
<AstroImage
|
||||
src={image.url}
|
||||
|
@ -47,7 +45,7 @@ const localizedDate = new Intl.DateTimeFormat(currentLocale, {
|
|||
height={image.height}
|
||||
/>
|
||||
)
|
||||
}
|
||||
} -->
|
||||
<hr />
|
||||
<slot />
|
||||
</BaseLayout>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue