mirror of
https://github.com/10h30/astroplate.git
synced 2026-07-19 14:43:29 +09:00
updated to astro v3.6
This commit is contained in:
@@ -1,23 +1,26 @@
|
||||
---
|
||||
import BlogCard from "@/components/BlogCard.astro";
|
||||
import Share from "@/components/Share.astro";
|
||||
import config from "@/config/config.json";
|
||||
import Disqus from "@/helpers/Disqus";
|
||||
import { getSinglePage } from "@/lib/contentParser.astro";
|
||||
import dateFormat from "@/lib/utils/dateFormat";
|
||||
import similerItems from "@/lib/utils/similarItems";
|
||||
import similarItems from "@/lib/utils/similarItems";
|
||||
import { humanize, markdownify, slugify } from "@/lib/utils/textConverter";
|
||||
import { Image } from "astro:assets";
|
||||
import { getCollection } from "astro:content";
|
||||
import {
|
||||
FaRegClock,
|
||||
FaRegFolder,
|
||||
FaRegUserCircle,
|
||||
} from "react-icons/fa/index.js";
|
||||
|
||||
const { blog_folder } = config.settings;
|
||||
const posts = await getSinglePage(blog_folder);
|
||||
const COLLECTION_FOLDER = "blog";
|
||||
const { post } = Astro.props;
|
||||
const similarPosts = similerItems(post, posts, post.slug);
|
||||
|
||||
const posts = await getCollection(
|
||||
COLLECTION_FOLDER,
|
||||
({ data, slug }) => !data.draft && slug !== "-index",
|
||||
);
|
||||
const similarPosts = similarItems(post, posts);
|
||||
const { Content } = await post.render();
|
||||
const { title, description, author, categories, image, date, tags } = post.data;
|
||||
---
|
||||
|
||||
@@ -25,7 +25,7 @@ interface SearchResult {
|
||||
refIndex: number;
|
||||
}
|
||||
|
||||
const Search = ({ searchList }: Props) => {
|
||||
const SearchLayout = ({ searchList }: Props) => {
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
const [inputVal, setInputVal] = useState("");
|
||||
const [searchResults, setSearchResults] = useState<SearchResult[]>([]);
|
||||
@@ -178,4 +178,4 @@ const Search = ({ searchList }: Props) => {
|
||||
);
|
||||
};
|
||||
|
||||
export default Search;
|
||||
export default SearchLayout;
|
||||
|
||||
@@ -20,7 +20,7 @@ export interface ISocial {
|
||||
rel="noopener noreferrer nofollow"
|
||||
>
|
||||
<span class="sr-only">{social.name}</span>
|
||||
<DynamicIcon class="inline-block" icon={social.icon} />
|
||||
<DynamicIcon className="inline-block" icon={social.icon} />
|
||||
</a>
|
||||
</li>
|
||||
))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { FC } from "react";
|
||||
import React, { type FC } from "react";
|
||||
import type { IconType } from "react-icons";
|
||||
import * as FaIcons from "react-icons/fa6/index.js";
|
||||
// import * as AiIcons from "react-icons/ai/index.js";
|
||||
|
||||
Reference in New Issue
Block a user