aboutsummaryrefslogtreecommitdiff
path: root/examples/docs
diff options
context:
space:
mode:
authorGravatar Juan Martín Seery <me@juanm04.com> 2022-04-03 16:02:57 -0300
committerGravatar GitHub <noreply@github.com> 2022-04-03 14:02:57 -0500
commitdc6e89f0a32952568def085a7c6eb79fae697303 (patch)
tree0312982227102e618f6f2f239f4bf25e32625f4c /examples/docs
parentdff89a0fa3d51d1473e8a19b000ba8a76261d060 (diff)
downloadastro-dc6e89f0a32952568def085a7c6eb79fae697303.tar.gz
astro-dc6e89f0a32952568def085a7c6eb79fae697303.tar.zst
astro-dc6e89f0a32952568def085a7c6eb79fae697303.zip
chore: updated examples to v0.26.0 (#2977)
* New script behavior * Astro.request * Reverted `deno` to `node` * Updated subpath
Diffstat (limited to 'examples/docs')
-rw-r--r--examples/docs/src/components/HeadCommon.astro6
-rw-r--r--examples/docs/src/components/LeftSidebar/LeftSidebar.astro2
-rw-r--r--examples/docs/src/layouts/MainLayout.astro2
-rw-r--r--examples/docs/src/pages/index.astro2
4 files changed, 6 insertions, 6 deletions
diff --git a/examples/docs/src/components/HeadCommon.astro b/examples/docs/src/components/HeadCommon.astro
index 21504cf89..b6a74cdc6 100644
--- a/examples/docs/src/components/HeadCommon.astro
+++ b/examples/docs/src/components/HeadCommon.astro
@@ -18,10 +18,10 @@ import '../styles/index.css';
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital@0;1&display=swap" rel="stylesheet" />
<!-- Scrollable a11y code helper -->
-<script type="module" src="/make-scrollable-code-focusable.js"></script>
+<script src="/make-scrollable-code-focusable.js" is:inline></script>
<!-- This is intentionally inlined to avoid FOUC -->
-<script>
+<script is:inline>
const root = document.documentElement;
const theme = localStorage.getItem('theme');
if (theme === 'dark' || (!theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
@@ -32,7 +32,7 @@ import '../styles/index.css';
</script>
<!-- Global site tag (gtag.js) - Google Analytics -->
-<!-- <script async src="https://www.googletagmanager.com/gtag/js?id=G-TEL60V1WM9"></script>
+<!-- <script async src="https://www.googletagmanager.com/gtag/js?id=G-TEL60V1WM9" is:inline></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
diff --git a/examples/docs/src/components/LeftSidebar/LeftSidebar.astro b/examples/docs/src/components/LeftSidebar/LeftSidebar.astro
index 99a03213d..107423385 100644
--- a/examples/docs/src/components/LeftSidebar/LeftSidebar.astro
+++ b/examples/docs/src/components/LeftSidebar/LeftSidebar.astro
@@ -43,7 +43,7 @@ const sidebarSections = SIDEBAR[langCode].reduce((col, item, i) => {
</ul>
</nav>
-<script>
+<script is:inline>
window.addEventListener('DOMContentLoaded', (event) => {
var target = document.querySelector('[aria-current="page"]');
if (target && target.offsetTop > window.innerHeight - 100) {
diff --git a/examples/docs/src/layouts/MainLayout.astro b/examples/docs/src/layouts/MainLayout.astro
index 8c46278fe..9939592a9 100644
--- a/examples/docs/src/layouts/MainLayout.astro
+++ b/examples/docs/src/layouts/MainLayout.astro
@@ -9,7 +9,7 @@ import RightSidebar from '../components/RightSidebar/RightSidebar.astro';
import * as CONFIG from '../config';
const { content = {} } = Astro.props;
-const currentPage = Astro.request.url.pathname;
+const currentPage = new URL(Astro.request.url).pathname;
const currentFile = `src/pages${currentPage.replace(/\/$/, '')}.md`;
const githubEditUrl = CONFIG.GITHUB_EDIT_URL && CONFIG.GITHUB_EDIT_URL + currentFile;
---
diff --git a/examples/docs/src/pages/index.astro b/examples/docs/src/pages/index.astro
index 4ce893162..bce06972f 100644
--- a/examples/docs/src/pages/index.astro
+++ b/examples/docs/src/pages/index.astro
@@ -1,4 +1,4 @@
-<script>
+<script is:inline>
// Redirect your homepage to the first page of documentation.
// If you have a landing page, remove this script and add it here!
window.location.pathname = `/en/introduction`;