-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cli): add generate command to create localized astro pages
- use yargs to build documented command - use typescript compiler API to parse frontmatter & inject locale change - update dependencies to latest closes #13
- Loading branch information
1 parent
3a5db5f
commit 0827461
Showing
18 changed files
with
3,743 additions
and
1,367 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
--- | ||
import i18next from "i18next"; | ||
import About from "templates:About"; | ||
import { t, changeLanguage } from "i18next"; | ||
import { Trans } from "astro-i18next/components"; | ||
import BaseTemplate from "templates:BaseTemplate"; | ||
import Link from "atoms:Link"; | ||
changeLanguage("en"); | ||
i18next.changeLanguage(i18next.options.supportedLngs[0]); | ||
--- | ||
|
||
<About /> | ||
<BaseTemplate> | ||
<p class="mt-4 text-center text-xl max-w-xl"> | ||
<Trans i18nKey="about"> | ||
Created with love ❤️, cheese 🧀 and baguettes 🥖 during the <Link | ||
href="https://hackathon-1-0-projects.vercel.app/" | ||
title={t("astroHackathonTitle")} | ||
>Astro hackathon | ||
</Link> of April / May 2022 by <Link | ||
href="https://twitter.com/yassinedoghri" | ||
title={t("twitterTitle")} | ||
>@yassinedoghri | ||
</Link>. | ||
</Trans> | ||
</p> | ||
</BaseTemplate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
import { t, changeLanguage } from "i18next"; | ||
import { Trans } from "astro-i18next/components"; | ||
import BaseTemplate from "templates:BaseTemplate"; | ||
import Link from "atoms:Link"; | ||
changeLanguage("fr"); | ||
--- | ||
|
||
<BaseTemplate> | ||
<p class="mt-4 text-center text-xl max-w-xl"> | ||
<Trans i18nKey="about"> | ||
Created with love ❤️, cheese 🧀 and baguettes 🥖 during the <Link | ||
href="https://hackathon-1-0-projects.vercel.app/" | ||
title={t("astroHackathonTitle")} | ||
>Astro hackathon | ||
</Link> of April / May 2022 by <Link | ||
href="https://twitter.com/yassinedoghri" | ||
title={t("twitterTitle")} | ||
>@yassinedoghri | ||
</Link>. | ||
</Trans> | ||
</p> | ||
</BaseTemplate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
import Link from "atoms:Link"; | ||
import { t, changeLanguage } from "i18next"; | ||
import { Trans } from "astro-i18next/components"; | ||
import BaseTemplate from "templates:BaseTemplate"; | ||
changeLanguage("fr"); | ||
--- | ||
|
||
<BaseTemplate> | ||
<p class="mt-4 text-center text-xl max-w-xl"> | ||
<Trans i18nKey="description"> | ||
An <Link href="https://astro.build" title={t("astroTitle")}>astro</Link> integration | ||
of <Link href="https://www.i18next.com/" title={t("i18nextTitle")} | ||
>i18next | ||
</Link> and utility components to help you translate your astro websites! | ||
</Trans> | ||
</p> | ||
</BaseTemplate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,20 @@ | ||
--- | ||
import i18next from "i18next"; | ||
import Home from "templates:Home"; | ||
import Link from "atoms:Link"; | ||
import { t, changeLanguage } from "i18next"; | ||
import { Trans } from "astro-i18next/components"; | ||
import BaseTemplate from "templates:BaseTemplate"; | ||
changeLanguage("en"); | ||
i18next.changeLanguage(i18next.options.supportedLngs[0]); | ||
--- | ||
|
||
<Home /> | ||
<BaseTemplate> | ||
<p class="mt-4 text-center text-xl max-w-xl"> | ||
<Trans i18nKey="description"> | ||
An <Link href="https://astro.build" title={t("astroTitle")}>astro</Link> integration | ||
of <Link href="https://www.i18next.com/" title={t("i18nextTitle")} | ||
>i18next | ||
</Link> and utility components to help you translate your astro websites! | ||
</Trans> | ||
</p> | ||
</BaseTemplate> |
Oops, something went wrong.