Add albums to the project
This commit is contained in:
@@ -11,6 +11,12 @@ export default defineConfig({
|
|||||||
domains: ['development.directus.itsfinniii.com']
|
domains: ['development.directus.itsfinniii.com']
|
||||||
},
|
},
|
||||||
vite: {
|
vite: {
|
||||||
plugins: [tailwindcss(), graphql()]
|
plugins: [tailwindcss(), graphql()],
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
react: "preact/compat",
|
||||||
|
"react-dom": "preact/compat",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -14,6 +14,7 @@ import ProjectPost from "@/components/projects/ProjectPost.astro";
|
|||||||
import CategoryIndex from "@/components/photos/CategoryIndex.astro";
|
import CategoryIndex from "@/components/photos/CategoryIndex.astro";
|
||||||
import Category from "@/components/photos/Category.astro";
|
import Category from "@/components/photos/Category.astro";
|
||||||
import { getImageUrl } from "@/lib/images";
|
import { getImageUrl } from "@/lib/images";
|
||||||
|
import AlbumPage from "@/components/photos/AlbumPage.astro";
|
||||||
|
|
||||||
export async function getStaticPaths() {
|
export async function getStaticPaths() {
|
||||||
const settings = await getSettings();
|
const settings = await getSettings();
|
||||||
@@ -144,6 +145,22 @@ if (page === null || page.page === null || !page.page.exists) {
|
|||||||
</WebpageLayout>
|
</WebpageLayout>
|
||||||
) }
|
) }
|
||||||
|
|
||||||
|
{ page.pageType === "PhotoAlbum" && (
|
||||||
|
<WebpageLayout settings={{
|
||||||
|
searchEngine: {
|
||||||
|
title: page.page.category.title,
|
||||||
|
description: `See the photos in the ${page.page.category.title.toLowerCase()} category.`,
|
||||||
|
allowCrawlers: true,
|
||||||
|
canonical: null,
|
||||||
|
priority: 65,
|
||||||
|
thumbnail: page.page.category.thumbnail
|
||||||
|
}}}>
|
||||||
|
<Fragment slot="content">
|
||||||
|
<AlbumPage album={page.page} />
|
||||||
|
</Fragment>
|
||||||
|
</WebpageLayout>
|
||||||
|
) }
|
||||||
|
|
||||||
{ page.pageType === "Photo" && (
|
{ page.pageType === "Photo" && (
|
||||||
<PhotoLayout settings={{
|
<PhotoLayout settings={{
|
||||||
searchEngine: {
|
searchEngine: {
|
||||||
|
|||||||
5
astro/src/types/photos/photo.d.ts
vendored
5
astro/src/types/photos/photo.d.ts
vendored
@@ -10,3 +10,8 @@ type PhotoPage = {
|
|||||||
title: string;
|
title: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PhotoAlbumItem = {
|
||||||
|
photo: PhotoProps;
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user