mirror of
https://github.com/10h30/astroplate.git
synced 2026-07-13 11:46:17 +09:00
update packages
This commit is contained in:
@@ -3,8 +3,8 @@ 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 removeDrafts = removeIndex.filter((data) => !data.data.draft);
|
||||
const removeIndex = allPage.filter((data: any) => data.id.match(/^(?!-)/));
|
||||
const removeDrafts = removeIndex.filter((data: any) => !data.data.draft);
|
||||
return removeDrafts;
|
||||
};
|
||||
---
|
||||
|
||||
@@ -5,7 +5,7 @@ import { slugify } from "./utils/textConverter";
|
||||
// get all taxonomies from frontmatter
|
||||
export const getTaxonomy = async (collection: string, name: string) => {
|
||||
const singlePages = await getSinglePage(collection);
|
||||
const taxonomyPages = singlePages.map((page) => page.data[name]);
|
||||
const taxonomyPages = singlePages.map((page: any) => page.data[name]);
|
||||
let taxonomies: string[] = [];
|
||||
for (let i = 0; i < taxonomyPages.length; i++) {
|
||||
const categoryArray = taxonomyPages[i];
|
||||
@@ -19,7 +19,7 @@ export const getTaxonomy = async (collection: string, name: string) => {
|
||||
|
||||
export const getAllTaxonomy = async (collection: string, name: string) => {
|
||||
const singlePages = await getSinglePage(collection);
|
||||
const taxonomyPages = singlePages.map((page) => page.data[name]);
|
||||
const taxonomyPages = singlePages.map((page: any) => page.data[name]);
|
||||
let taxonomies: string[] = [];
|
||||
for (let i = 0; i < taxonomyPages.length; i++) {
|
||||
const categoryArray = taxonomyPages[i];
|
||||
|
||||
Reference in New Issue
Block a user