mirror of
https://github.com/10h30/astroplate.git
synced 2026-06-05 15:08:00 +09:00
modified contentParser and index.md file for blog and author, fixed issue #2
This commit is contained in:
@@ -77,7 +77,7 @@ const { pathname } = Astro.url;
|
||||
<path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z" />
|
||||
</svg>
|
||||
</span>
|
||||
<ul class="nav-dropdown-list hidden group-hover:block md:invisible md:absolute md:block md:opacity-0 md:group-hover:visible md:group-hover:opacity-100">
|
||||
<ul class="nav-dropdown-list hidden group-hover:block lg:invisible lg:absolute lg:block lg:opacity-0 lg:group-hover:visible lg:group-hover:opacity-100">
|
||||
{menu.children?.map((child) => (
|
||||
<li class="nav-dropdown-item">
|
||||
<a
|
||||
|
||||
@@ -3,7 +3,7 @@ import { getCollection } from "astro:content";
|
||||
|
||||
export const getSinglePage = async (collection: any) => {
|
||||
const allPage = await getCollection(collection);
|
||||
const removeIndex = allPage.filter((data) => data.id.match(/^(?!_)/));
|
||||
const removeIndex = allPage.filter((data) => data.id !== "index.md");
|
||||
const removeDrafts = removeIndex.filter((data) => !data.data.draft);
|
||||
return removeDrafts;
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@ import { getSinglePage } from "@/lib/contentParser.astro";
|
||||
import PageHeader from "@/partials/PageHeader.astro";
|
||||
import { getEntryBySlug } from "astro:content";
|
||||
|
||||
const authorIndex = await getEntryBySlug<any, string>("authors", "_index");
|
||||
const authorIndex = await getEntryBySlug<any, string>("authors", "index");
|
||||
const authors = await getSinglePage("authors");
|
||||
---
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
---
|
||||
import { Image } from "@astrojs/image/components";
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import { markdownify } from "@/lib/utils/textConverter";
|
||||
import CallToAction from "@/partials/CallToAction.astro";
|
||||
import Testimonial from "@/partials/Testimonial.astro";
|
||||
import { Image } from "@astrojs/image/components";
|
||||
import { getEntryBySlug } from "astro:content";
|
||||
import { FaCheck } from "react-icons/fa/index.js";
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import PostSidebar from "@/partials/PostSidebar.astro";
|
||||
import { getEntryBySlug } from "astro:content";
|
||||
|
||||
const { blog_folder } = config.settings;
|
||||
const postIndex = await getEntryBySlug<any, string>(blog_folder, "_index");
|
||||
const postIndex = await getEntryBySlug<any, string>(blog_folder, "index");
|
||||
const posts = await getSinglePage(blog_folder);
|
||||
const allCategories = await getAllTaxonomy(blog_folder, "categories");
|
||||
const categories = await getTaxonomy(blog_folder, "categories");
|
||||
|
||||
@@ -12,7 +12,7 @@ import { getEntryBySlug } from "astro:content";
|
||||
|
||||
const { blog_folder } = config.settings;
|
||||
const { slug } = Astro.params;
|
||||
const postIndex = await getEntryBySlug<any, string>(blog_folder, "_index");
|
||||
const postIndex = await getEntryBySlug<any, string>(blog_folder, "index");
|
||||
const posts = await getSinglePage(blog_folder);
|
||||
const allCategories = await getAllTaxonomy(blog_folder, "categories");
|
||||
const categories = await getTaxonomy(blog_folder, "categories");
|
||||
|
||||
Reference in New Issue
Block a user