fix: remove turbo experiment again

This commit is contained in:
iCrawl
2022-10-09 00:19:53 +02:00
parent 723c0b9b55
commit 1ea7664aa3
5 changed files with 3 additions and 19 deletions

View File

@@ -10,18 +10,18 @@ type Props = MarkdownLayoutProps<{}>;
const { headings } = Astro.props;
---
<script is:inline>
<script>
window.addEventListener('load', () => {
const headings = document.querySelectorAll(
'div.level-h1 > h1, div.level-h2 > h2, div.level-h3 > h3, div.level-h4 > h4',
);
const headingsObserver = new IntersectionObserver(
(entries, observer) => {
(entries) => {
entries.forEach((entry) => {
if (entry.isIntersecting) {
const location = window.location.toString().split('#')[0];
history.replaceState(null, null, location + '#' + entry.target.id);
history.replaceState(null, '', location + '#' + entry.target.id);
}
});
},

View File

@@ -32,10 +32,6 @@ const props = Astro.props;
<title>discord.js</title>
<meta content="minimum-scale=1, initial-scale=1, width=device-width" name="viewport" />
<meta content="#5865f2" name="theme-color" />
<script>
import '../scripts/router.js';
</script>
</head>
<body class="dark:bg-dark-800 bg-white">
<script is:inline>

View File

@@ -1,3 +0,0 @@
import * as turbo from '@hotwired/turbo';
turbo.start();