Skip to content

Commit a86bb4f

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

5 files changed

Lines changed: 21 additions & 1 deletion

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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const {
1010
import { ViewTransitions } from "astro:transitions";
1111
import Footer from "../components/Footer.astro";
1212
import NavLink from "../components/NavLink.astro";
13+
import turboModule from "../scripts/turbo.ts?url";
1314
1415
const defaultTitle = "Dani Bengl - Full-Stack Developer";
1516
const defaultDescription =
@@ -47,6 +48,7 @@ const structuredData = {
4748
keywords: tags.join(", "),
4849
}),
4950
};
51+
5052
---
5153

5254
<html lang="en">
@@ -92,7 +94,6 @@ const structuredData = {
9294
set:html={JSON.stringify(structuredData)}
9395
/>
9496

95-
<ViewTransitions />
9697
<style>
9798
* {
9899
box-sizing: border-box;
@@ -207,6 +208,8 @@ const structuredData = {
207208

208209
<Footer />
209210

211+
<script type="module" src={turboModule}></script>
212+
210213
<script>
211214
function makeTablesResponsive() {
212215
const tables = document.querySelectorAll("table");

src/scripts/turbo.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import * as Turbo from "@hotwired/turbo";
2+
3+
Turbo.setProgressBarDelay(100);
4+
Turbo.start();

0 commit comments

Comments
 (0)