mirror of
https://github.com/10h30/astroplate.git
synced 2026-07-14 04:06:21 +09:00
category && tag single static path modifed
This commit is contained in:
@@ -10,7 +10,7 @@ import config from "@/config/config.json";
|
||||
|
||||
export const getSinglePage = async <C extends CollectionKey>(
|
||||
collectionName: C,
|
||||
lang: keyof ContentEntryMap,
|
||||
lang: keyof ContentEntryMap
|
||||
): Promise<CollectionEntry<C>[]> => {
|
||||
const { default_language } = config.settings;
|
||||
const langCollection: keyof ContentEntryMap = lang as keyof ContentEntryMap;
|
||||
@@ -20,7 +20,7 @@ export const getSinglePage = async <C extends CollectionKey>(
|
||||
langCollection || default_language,
|
||||
({ id }: any) => {
|
||||
return id.startsWith(collectionName) && !id.endsWith("-index.md");
|
||||
},
|
||||
}
|
||||
)) as CollectionEntry<C>[];
|
||||
|
||||
//@ts-ignore
|
||||
@@ -30,7 +30,7 @@ export const getSinglePage = async <C extends CollectionKey>(
|
||||
|
||||
export const getListPage = async <C extends CollectionKey>(
|
||||
collectionName: C,
|
||||
lang: keyof ContentEntryMap,
|
||||
lang: keyof ContentEntryMap
|
||||
): Promise<CollectionEntry<C>[]> => {
|
||||
const { default_language } = config.settings;
|
||||
const langCollection: keyof ContentEntryMap = lang as keyof ContentEntryMap;
|
||||
@@ -39,7 +39,7 @@ export const getListPage = async <C extends CollectionKey>(
|
||||
langCollection || default_language,
|
||||
({ id }: any) => {
|
||||
return id.startsWith(collectionName);
|
||||
},
|
||||
}
|
||||
)) as CollectionEntry<C>[];
|
||||
|
||||
return pages;
|
||||
|
||||
@@ -14,7 +14,7 @@ export const getTaxonomy = async (collection: any, name: string) => {
|
||||
actualCollection as keyof ContentEntryMap,
|
||||
({ id }: any) => {
|
||||
return id.startsWith("blog") && !id.endsWith("-index.md");
|
||||
},
|
||||
}
|
||||
);
|
||||
const taxonomyPages = singlePages.map((page: any) => page.data[name]);
|
||||
let taxonomies: string[] = [];
|
||||
@@ -37,7 +37,7 @@ export const getAllTaxonomy = async (collection: any, name: string) => {
|
||||
actualCollection as keyof ContentEntryMap,
|
||||
({ id }: any) => {
|
||||
return id.startsWith("blog") && !id.endsWith("-index.md");
|
||||
},
|
||||
}
|
||||
);
|
||||
const taxonomyPages = singlePages.map((page: any) => page.data[name]);
|
||||
let taxonomies: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user