Skip to content

Commit 3d19d5a

Browse files
committed
Add turbo, remove view-transitions
1 parent fd1ed46 commit 3d19d5a

5 files changed

Lines changed: 22 additions & 3 deletions

File tree

package-lock.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@astrojs/mdx": "^3.1.2",
1818
"@astrojs/rss": "^4.0.11",
1919
"@astrojs/sitemap": "^3.4.1",
20+
"@hotwired/turbo": "^8.0.20",
2021
"astro": "^4.11.5",
2122
"markdown-it": "^14.1.0",
2223
"prettier": "^3.3.2",

src/env.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/// <reference path="../.astro/types.d.ts" />
22
/// <reference types="astro/client" />
3+
4+
declare module "@hotwired/turbo";

src/layouts/BaseLayout.astro

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const {
77
publishedAt,
88
tags,
99
} = Astro.props.frontmatter || Astro.props;
10-
import { ViewTransitions } from "astro:transitions";
1110
import Footer from "../components/Footer.astro";
1211
import NavLink from "../components/NavLink.astro";
1312
@@ -47,6 +46,7 @@ const structuredData = {
4746
keywords: tags.join(", "),
4847
}),
4948
};
49+
5050
---
5151

5252
<html lang="en">
@@ -92,7 +92,6 @@ const structuredData = {
9292
set:html={JSON.stringify(structuredData)}
9393
/>
9494

95-
<ViewTransitions />
9695
<style>
9796
* {
9897
box-sizing: border-box;
@@ -207,6 +206,13 @@ const structuredData = {
207206

208207
<Footer />
209208

209+
<script>
210+
import * as Turbo from "@hotwired/turbo";
211+
212+
Turbo.setProgressBarDelay(100);
213+
Turbo.start();
214+
</script>
215+
210216
<script>
211217
function makeTablesResponsive() {
212218
const tables = document.querySelectorAll("table");

src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const projects = await getCollection("projects");
4141
productivity that Rails brings to development.
4242
</p>
4343

44-
<nav class="actions" aria-label="Quick navigation">
44+
<nav class="actions" aria-label="Quick navigation" data-turbo-prefetch="true">
4545
<ul>
4646
<li><a href="/about" class="button">About Me</a></li>
4747
<li><a href="/projects" class="button">View Projects</a></li>

0 commit comments

Comments
 (0)