mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
Move types definition under src directory
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import Datetime from "./Datetime";
|
import Datetime from "./Datetime";
|
||||||
import type { Frontmatter } from "@utils/types";
|
import type { Frontmatter } from "src/types";
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
href?: string;
|
href?: string;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import Fuse from "fuse.js";
|
import Fuse from "fuse.js";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import Card from "@components/Card";
|
import Card from "@components/Card";
|
||||||
import type { Frontmatter } from "@utils/types";
|
import type { Frontmatter } from "src/types";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
searchList: {
|
searchList: {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import rss from "@astrojs/rss";
|
import rss from "@astrojs/rss";
|
||||||
import type { Frontmatter } from "@utils/types";
|
import type { Frontmatter } from "src/types";
|
||||||
import type { MarkdownInstance } from "astro";
|
import type { MarkdownInstance } from "astro";
|
||||||
|
|
||||||
const postImportResult = import.meta.glob<MarkdownInstance<Frontmatter>>(
|
const postImportResult = import.meta.glob<MarkdownInstance<Frontmatter>>(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { MarkdownInstance } from "astro";
|
import type { MarkdownInstance } from "astro";
|
||||||
import { slufigyAll } from "./slugify";
|
import { slufigyAll } from "./slugify";
|
||||||
import type { Frontmatter } from "./types";
|
import type { Frontmatter } from "../types";
|
||||||
|
|
||||||
const getPostsByTag = (posts: MarkdownInstance<Frontmatter>[], tag: string) =>
|
const getPostsByTag = (posts: MarkdownInstance<Frontmatter>[], tag: string) =>
|
||||||
posts.filter((post) => slufigyAll(post.frontmatter.tags).includes(tag));
|
posts.filter((post) => slufigyAll(post.frontmatter.tags).includes(tag));
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { MarkdownInstance } from "astro";
|
import type { MarkdownInstance } from "astro";
|
||||||
import type { Frontmatter } from "./types";
|
import type { Frontmatter } from "../types";
|
||||||
|
|
||||||
const getSortedPosts = (posts: MarkdownInstance<Frontmatter>[]) =>
|
const getSortedPosts = (posts: MarkdownInstance<Frontmatter>[]) =>
|
||||||
posts.sort(
|
posts.sort(
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import slugify from "./slugify";
|
import slugify from "./slugify";
|
||||||
import type { MarkdownInstance } from "astro";
|
import type { MarkdownInstance } from "astro";
|
||||||
import type { Frontmatter } from "./types";
|
import type { Frontmatter } from "../types";
|
||||||
|
|
||||||
const getUniqueTags = (posts: MarkdownInstance<Frontmatter>[]) => {
|
const getUniqueTags = (posts: MarkdownInstance<Frontmatter>[]) => {
|
||||||
let tags: string[] = [];
|
let tags: string[] = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user