Add page routing and content fetchers
This commit is contained in:
@@ -17,6 +17,15 @@ export async function getAllRoutesList(settings: GlobalSettings): Promise<string
|
||||
if (settings.blog.enabled) {
|
||||
const blogs = await getAllBlogs(settings);
|
||||
|
||||
for (let i = 0; i < Math.ceil(blogs.length / 6); i++) {
|
||||
if (i !== 0) {
|
||||
routes.push(`${settings.blog.indexRouteTemplate}/${i + 1}`);
|
||||
}
|
||||
else {
|
||||
routes.push(settings.blog.indexRouteTemplate);
|
||||
}
|
||||
}
|
||||
|
||||
blogs.forEach((blog) => {
|
||||
routes.push(getBlogRoute(settings.blog, blog));
|
||||
});
|
||||
@@ -24,6 +33,15 @@ export async function getAllRoutesList(settings: GlobalSettings): Promise<string
|
||||
if (settings.project.enabled) {
|
||||
const projects = await getAllProjects(settings);
|
||||
|
||||
for (let i = 0; i < Math.ceil(projects.length / 4); i++) {
|
||||
if (i !== 0) {
|
||||
routes.push(`${settings.project.indexRouteTemplate}/${i + 1}`);
|
||||
}
|
||||
else {
|
||||
routes.push(settings.project.indexRouteTemplate);
|
||||
}
|
||||
}
|
||||
|
||||
projects.forEach((project) => {
|
||||
routes.push(getProjectRoute(settings.project, project));
|
||||
});
|
||||
@@ -32,6 +50,8 @@ export async function getAllRoutesList(settings: GlobalSettings): Promise<string
|
||||
const categories = await getAllCategories(settings);
|
||||
const galleries = await getAllAlbums(settings);
|
||||
|
||||
routes.push(settings.photo.categoryIndex.indexRouteTemplate);
|
||||
|
||||
categories.forEach((category) => {
|
||||
let albums = galleries.filter(g => g.category.id === category.id);
|
||||
const pages = Math.ceil(albums.length / settings.photo.category.perPage);
|
||||
|
||||
Reference in New Issue
Block a user