Skip to content
This repository was archived by the owner on Apr 2, 2026. It is now read-only.

Commit f7a5fae

Browse files
Move __basePath script to _header.html where template context exists
_head.html is included without context (no dot), so {{.Site.BaseURL}} rendered as empty string. _header.html gets the full context.
1 parent e2b450b commit f7a5fae

2 files changed

Lines changed: 1 addition & 1 deletion

File tree

templates/_head.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@
66
<link rel="preconnect" href="https://fonts.googleapis.com">
77
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
88
<link href="https://fonts.googleapis.com/css2?family=Public+Sans:wght@200;300;400;500;600;700&family=Martian+Mono:wght@300;400;500&family=Lexend+Peta:wght@400&display=swap" rel="stylesheet">
9-
<script>var __basePath = (function() { try { return new URL("{{.Site.BaseURL}}").pathname.replace(/\/$/, ""); } catch(e) { return ""; } })();</script>

templates/_header.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<script>var __basePath = (function() { try { return new URL("{{.Site.BaseURL}}").pathname.replace(/\/$/, ""); } catch(e) { return ""; } })();</script>
12
<a href="#main-content" class="skip-link">Skip to content</a>
23
<header class="site-header">
34
<div class="container">

0 commit comments

Comments
 (0)