mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 07:33:07 +08:00
Move types definition under src directory
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { MarkdownInstance } from "astro";
|
||||
import { slufigyAll } from "./slugify";
|
||||
import type { Frontmatter } from "./types";
|
||||
import type { Frontmatter } from "../types";
|
||||
|
||||
const getPostsByTag = (posts: MarkdownInstance<Frontmatter>[], tag: string) =>
|
||||
posts.filter((post) => slufigyAll(post.frontmatter.tags).includes(tag));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { MarkdownInstance } from "astro";
|
||||
import type { Frontmatter } from "./types";
|
||||
import type { Frontmatter } from "../types";
|
||||
|
||||
const getSortedPosts = (posts: MarkdownInstance<Frontmatter>[]) =>
|
||||
posts.sort(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import slugify from "./slugify";
|
||||
import type { MarkdownInstance } from "astro";
|
||||
import type { Frontmatter } from "./types";
|
||||
import type { Frontmatter } from "../types";
|
||||
|
||||
const getUniqueTags = (posts: MarkdownInstance<Frontmatter>[]) => {
|
||||
let tags: string[] = [];
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
export interface Frontmatter {
|
||||
title: string;
|
||||
ogImage?: string;
|
||||
description: string;
|
||||
author: string;
|
||||
datetime: string;
|
||||
slug: string;
|
||||
featured: boolean;
|
||||
tags: string[];
|
||||
}
|
||||
Reference in New Issue
Block a user