Support album-based photo lookup & routing
This commit is contained in:
29
astro/src/pages/[...route].astro
Normal file
29
astro/src/pages/[...route].astro
Normal file
@@ -0,0 +1,29 @@
|
||||
---
|
||||
import { getAllRoutesList } from "@/lib/routing";
|
||||
import { getPage } from "@/lib/pages";
|
||||
import { getSettings } from "@/content/settings/settings"
|
||||
import WebpageLayout from "@/layouts/WebpageLayout.astro";
|
||||
|
||||
export async function getStaticPaths() {
|
||||
const settings = await getSettings();
|
||||
const pages = await getAllRoutesList(settings);
|
||||
|
||||
console.log(pages);
|
||||
|
||||
let routes: any[] = [];
|
||||
|
||||
pages.forEach((page) => {
|
||||
routes.push({ params: { route: page } });
|
||||
})
|
||||
|
||||
return routes;
|
||||
}
|
||||
|
||||
const settings = await getSettings();
|
||||
const routes = await getAllRoutesList(settings);
|
||||
const page = await getPage(settings, "/album/2026/mirai-nexus-2026/6c0e4453ab");
|
||||
---
|
||||
|
||||
<WebpageLayout>
|
||||
<h1>Test</h1>
|
||||
</WebpageLayout>
|
||||
Reference in New Issue
Block a user