@anglefeint/astro-theme 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli-new-page.mjs +1 -1
- package/src/cli-new-post.mjs +1 -1
- package/src/i18n/config.ts +8 -4
- package/src/i18n/locales.mjs +3 -0
package/package.json
CHANGED
package/src/cli-new-page.mjs
CHANGED
|
@@ -65,7 +65,7 @@ function templateFor({ slug, theme }) {
|
|
|
65
65
|
return `---
|
|
66
66
|
import type { GetStaticPaths } from 'astro';
|
|
67
67
|
import ${layoutName} from '@anglefeint/astro-theme/layouts/${layoutName}.astro';
|
|
68
|
-
import { SUPPORTED_LOCALES } from '
|
|
68
|
+
import { SUPPORTED_LOCALES } from '@anglefeint/astro-theme/i18n/config';
|
|
69
69
|
|
|
70
70
|
export const getStaticPaths = (() => SUPPORTED_LOCALES.map((lang) => ({ params: { lang } }))) satisfies GetStaticPaths;
|
|
71
71
|
|
package/src/cli-new-post.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { mkdir, writeFile, access, readdir } from 'node:fs/promises';
|
|
2
2
|
import { constants } from 'node:fs';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
+
import { SUPPORTED_LOCALES } from './i18n/locales.mjs';
|
|
4
5
|
|
|
5
|
-
const SUPPORTED_LOCALES = ['en', 'ja', 'ko', 'es', 'zh'];
|
|
6
6
|
const CONTENT_ROOT = path.resolve(process.cwd(), 'src/content/blog');
|
|
7
7
|
const DEFAULT_COVERS_ROOT = path.resolve(process.cwd(), 'src/assets/blog/default-covers');
|
|
8
8
|
|
package/src/i18n/config.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
SUPPORTED_LOCALES as SUPPORTED_LOCALES_RUNTIME,
|
|
3
|
+
DEFAULT_LOCALE as DEFAULT_LOCALE_RUNTIME,
|
|
4
|
+
} from './locales.mjs';
|
|
5
|
+
|
|
6
|
+
export type Locale = 'en' | 'ja' | 'ko' | 'es' | 'zh';
|
|
7
|
+
export const SUPPORTED_LOCALES = SUPPORTED_LOCALES_RUNTIME as readonly Locale[];
|
|
8
|
+
export const DEFAULT_LOCALE: Locale = DEFAULT_LOCALE_RUNTIME as Locale;
|
|
5
9
|
|
|
6
10
|
export const LOCALE_LABELS: Record<Locale, string> = {
|
|
7
11
|
en: 'English',
|