Compare commits
3 Commits
abd98ff21b
...
aa93600c79
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa93600c79 | ||
|
|
0b45967d30 | ||
|
|
39c26e73c6 |
1479
astro/package-lock.json
generated
1479
astro/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
|||||||
import { getBlog } from "@/content/blogs/blogs";
|
import { getBlog } from "@/content/blogs/blogs";
|
||||||
import { getWebpage } from "@/content/pages/pages";
|
import { getWebpage } from "@/content/pages/pages";
|
||||||
import { getAlbum } from "@/content/photos/albums";
|
import { getAlbum } from "@/content/photos/albums";
|
||||||
|
import { getAllCategories } from "@/content/photos/categories";
|
||||||
import { getPhotoFromHash } from "@/content/photos/photos";
|
import { getPhotoFromHash } from "@/content/photos/photos";
|
||||||
import { getProject } from "@/content/projects/projects";
|
import { getProject } from "@/content/projects/projects";
|
||||||
|
|
||||||
@@ -91,10 +92,14 @@ export async function getPage(settings: GlobalSettings, route: string): Promise<
|
|||||||
}
|
}
|
||||||
// Photo Category Index
|
// Photo Category Index
|
||||||
else if (regexToRoute({ template: settings.photo.categoryIndex.indexRouteTemplate, allowPagination: false }).regex.test(route)) {
|
else if (regexToRoute({ template: settings.photo.categoryIndex.indexRouteTemplate, allowPagination: false }).regex.test(route)) {
|
||||||
|
const allCategories = await getAllCategories(settings);
|
||||||
|
const lastCategory = allCategories[0];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
route: route,
|
route: route,
|
||||||
pageType: "PhotoCategoryIndex",
|
pageType: "PhotoCategoryIndex",
|
||||||
page: {
|
page: {
|
||||||
|
category: lastCategory,
|
||||||
type: "PhotoCategoryIndex",
|
type: "PhotoCategoryIndex",
|
||||||
exists: true
|
exists: true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ export async function getAllRoutesList(settings: GlobalSettings): Promise<string
|
|||||||
const webpages = await getAllWebpages();
|
const webpages = await getAllWebpages();
|
||||||
|
|
||||||
webpages.forEach((webpage) => {
|
webpages.forEach((webpage) => {
|
||||||
|
if (webpage.exists) {
|
||||||
routes.push(webpage.url);
|
routes.push(webpage.url);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (settings.blog.enabled) {
|
if (settings.blog.enabled) {
|
||||||
@@ -48,6 +50,8 @@ export async function getAllRoutesList(settings: GlobalSettings): Promise<string
|
|||||||
}
|
}
|
||||||
if (settings.photo.enabled) {
|
if (settings.photo.enabled) {
|
||||||
const categories = await getAllCategories(settings);
|
const categories = await getAllCategories(settings);
|
||||||
|
|
||||||
|
if (categories.length > 0) {
|
||||||
const galleries = await getAllAlbums(settings);
|
const galleries = await getAllAlbums(settings);
|
||||||
|
|
||||||
routes.push(settings.photo.categoryIndex.indexRouteTemplate);
|
routes.push(settings.photo.categoryIndex.indexRouteTemplate);
|
||||||
@@ -85,6 +89,7 @@ export async function getAllRoutesList(settings: GlobalSettings): Promise<string
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return routes;
|
return routes;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,13 +147,13 @@ if (page === null || page.page === null || !page.page.exists) {
|
|||||||
{ page.pageType === "PhotoCategoryIndex" && (
|
{ page.pageType === "PhotoCategoryIndex" && (
|
||||||
<WebpageLayout settings={{
|
<WebpageLayout settings={{
|
||||||
searchEngine: {
|
searchEngine: {
|
||||||
title: "Projects",
|
title: "Categories",
|
||||||
description: "",
|
description: "",
|
||||||
allowCrawlers: true,
|
allowCrawlers: true,
|
||||||
canonical: null,
|
canonical: null,
|
||||||
priority: 65,
|
priority: 65,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: "",
|
url: page.page.category.thumbnail.url,
|
||||||
width: 1200,
|
width: 1200,
|
||||||
height: 630
|
height: 630
|
||||||
}
|
}
|
||||||
@@ -167,7 +167,7 @@ if (page === null || page.page === null || !page.page.exists) {
|
|||||||
{ page.pageType === "PhotoCategory" && (
|
{ page.pageType === "PhotoCategory" && (
|
||||||
<WebpageLayout settings={{
|
<WebpageLayout settings={{
|
||||||
searchEngine: {
|
searchEngine: {
|
||||||
title: "Projects",
|
title: "",
|
||||||
description: "",
|
description: "",
|
||||||
allowCrawlers: true,
|
allowCrawlers: true,
|
||||||
canonical: null,
|
canonical: null,
|
||||||
|
|||||||
2
astro/src/types/photos/category.d.ts
vendored
2
astro/src/types/photos/category.d.ts
vendored
@@ -1,4 +1,6 @@
|
|||||||
type PhotoCategoryIndex = {
|
type PhotoCategoryIndex = {
|
||||||
type: "PhotoCategoryIndex";
|
type: "PhotoCategoryIndex";
|
||||||
exists: boolean;
|
exists: boolean;
|
||||||
|
|
||||||
|
category: PhotoAlbumCategory;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user