Skip to content

Commit 8197911

Browse files
feat: enable view-transitions (and prefetching) (#412)
1 parent 926cc7b commit 8197911

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ export default defineConfig({
77
base: "",
88
integrations: [mdx(), solidJs()],
99
output: "static",
10+
prefetch: true,
1011
site: "https://maplibre.org/",
1112
});

src/layouts/Layout.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Footer from "../components/Footer.astro";
44
import Nav from "../components/Nav.astro";
55
import { SITE_TITLE } from "../constants";
66
const { title, description } = Astro.props;
7-
// import { ClientRouter } from 'astro:transitions';
7+
import { ClientRouter, fade } from "astro:transitions";
88
---
99

1010
<!doctype html>
@@ -19,7 +19,7 @@ const { title, description } = Astro.props;
1919
<meta name="viewport" content="width=device-width, initial-scale=1" />
2020
<meta name="author" content="MapLibre" />
2121
<meta name="description" content={description} />
22-
<!-- <ClientRouter /> -->
22+
<ClientRouter />
2323

2424
<meta
2525
property="og:image"
@@ -82,7 +82,7 @@ const { title, description } = Astro.props;
8282
{title ? `${title} | ${SITE_TITLE}` : SITE_TITLE}
8383
</title>
8484
</head>
85-
<body>
85+
<body transition:animate={fade({ duration: "0.2s" })}>
8686
<script
8787
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
8888
integrity="sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3"

0 commit comments

Comments
 (0)