From d5bd7515d33688019d66fc79841c116abffff118 Mon Sep 17 00:00:00 2001 From: Sat Naing Date: Sun, 11 Sep 2022 14:10:39 +0630 Subject: [PATCH] Update Frontmatter type from util --- src/components/Card.astro | 2 +- src/pages/index.astro | 11 +---------- src/pages/posts/[slug].astro | 2 +- src/pages/posts/index.astro | 2 +- src/pages/tags.astro | 2 +- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/components/Card.astro b/src/components/Card.astro index ddd9252..24b91b4 100644 --- a/src/components/Card.astro +++ b/src/components/Card.astro @@ -1,6 +1,6 @@ --- -import type { Frontmatter } from "src/pages/index.astro"; import Datetime from "./Datetime.astro"; +import type { Frontmatter } from "src/utils/types"; export interface Props { href?: string; diff --git a/src/pages/index.astro b/src/pages/index.astro index be671d7..ff74da6 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -6,16 +6,7 @@ import Footer from "@components/Footer.astro"; import LinkButton from "@components/LinkButton.astro"; import getSortedPosts from "src/utils/getSortedPosts"; import Hr from "@components/Hr.astro"; - -export interface Frontmatter { - title: string; - description: string; - author: string; - datetime: string; - slug: string; - featured: boolean; - tags: string[]; -} +import type { Frontmatter } from "src/utils/types"; const posts = await Astro.glob("../contents/*.md"); diff --git a/src/pages/posts/[slug].astro b/src/pages/posts/[slug].astro index 2e80af9..4809042 100644 --- a/src/pages/posts/[slug].astro +++ b/src/pages/posts/[slug].astro @@ -5,7 +5,7 @@ import Footer from "@components/Footer.astro"; import Datetime from "@components/Datetime.astro"; import Tag from "@components/Tag.astro"; import type { MarkdownInstance } from "astro"; -import type { Frontmatter } from "../index.astro"; +import type { Frontmatter } from "src/utils/types"; export interface Props { post: MarkdownInstance; diff --git a/src/pages/posts/index.astro b/src/pages/posts/index.astro index d68feee..45cd1bc 100644 --- a/src/pages/posts/index.astro +++ b/src/pages/posts/index.astro @@ -4,8 +4,8 @@ import Header from "@components/Header.astro"; import Footer from "@components/Footer.astro"; import Main from "@layouts/Main.astro"; import Card from "@components/Card.astro"; -import type { Frontmatter } from "../index.astro"; import getSortedPosts from "src/utils/getSortedPosts"; +import type { Frontmatter } from "src/utils/types"; const posts = await Astro.glob("../../contents/*.md"); diff --git a/src/pages/tags.astro b/src/pages/tags.astro index f5a8bcb..bbc8b8f 100644 --- a/src/pages/tags.astro +++ b/src/pages/tags.astro @@ -4,7 +4,7 @@ import Tag from "@components/Tag.astro"; import Layout from "@layouts/Layout.astro"; import Main from "@layouts/Main.astro"; import getUniqueTags from "src/utils/getUniqueTags"; -import type { Frontmatter } from "./index.astro"; +import type { Frontmatter } from "src/utils/types"; const posts = await Astro.glob("../contents/*.md");