diff --git a/src/content.config.ts b/src/content.config.ts index e558d7f..a98b95c 100644 --- a/src/content.config.ts +++ b/src/content.config.ts @@ -1,10 +1,8 @@ -// Import the glob loader import { glob } from "astro/loaders"; -// Import utilities from `astro:content` import { z, defineCollection } from "astro:content"; -// Define a `loader` and `schema` for each collection + const blog = defineCollection({ - loader: glob({ pattern: '**/[^_]*.md', base: "./src/blog" }), + loader: glob({ pattern: '**/post-*.md', base: "./src/blog" }), schema: z.object({ title: z.string(), pubDate: z.date(), @@ -12,5 +10,5 @@ const blog = defineCollection({ tags: z.array(z.string()) }) }); -// Export a single `collections` object to register your collection(s) + export const collections = { blog }; \ No newline at end of file diff --git a/src/layouts/MarkdownPostLayout.astro b/src/layouts/MarkdownPostLayout.astro index 3f228f9..6bc14ce 100644 --- a/src/layouts/MarkdownPostLayout.astro +++ b/src/layouts/MarkdownPostLayout.astro @@ -1,13 +1,20 @@ --- import BaseLayout from "./BaseLayout.astro"; const { frontmatter } = Astro.props; + +const optionsForDate = { + year: "numeric", + month: "long", + day: "numeric", + timeZone: "UTC", + timeZoneName:"short" +}; --- -

{frontmatter.pubDate.toLocaleDateString()}

-

{frontmatter.description}

+

Created on: {frontmatter.pubDate.toLocaleDateString("ja-JP", optionsForDate)}

Written by: {frontmatter.author}

- {frontmatter.image.alt} +

{frontmatter.description}

{ frontmatter.tags.map((tag: string) => ( diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[slug].astro similarity index 100% rename from src/pages/posts/[...slug].astro rename to src/pages/posts/[slug].astro diff --git a/tsconfig.json b/tsconfig.json index 3832a3d..d32d108 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,6 +9,8 @@ ], "compilerOptions": { "jsx": "react-jsx", - "jsxImportSource": "preact" + "jsxImportSource": "preact", + "strictNullChecks": true, + "allowJs": true } } \ No newline at end of file