Skip to content

Commit

Permalink
Use base url correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
williamyang98 committed Feb 7, 2025
1 parent 31b5f74 commit 0b7ccf6
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions docs/layouts/partials/custom/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<img src="">
</div>
</div>
<script type="module">
import { Popups, ResponsiveImages, Carousels, Benchmarks } from "{{ .Page.Site.BaseURL }}/js/custom.js";
<script type="module" async>
import { Popups, ResponsiveImages, Carousels, Benchmarks } from "{{ absURL "js/custom.js" }}";
let popups = new Popups();
let responsive_images = new ResponsiveImages(popups);
let carousels = new Carousels();
Expand Down
4 changes: 2 additions & 2 deletions docs/layouts/partials/custom/head-end.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
window.MathJax = {
startup: {
ready: () => {
const FONT_PATH = "{{ .Page.Site.BaseURL }}fonts";
const FONT_PATH = "{{ absURL "fonts" }}";
MathJax.config.chtml.fontURL = FONT_PATH;
MathJax.config.chtml.font.options.fontURL = FONT_PATH;
MathJax.startup.defaultReady();
}
}
};
</script>
<script id="MathJax-script" async src="{{ .Page.Site.BaseURL }}js/mathjax-3.2.2.js"></script>
<script id="MathJax-script" async src="{{ absURL "js/mathjax-3.2.2.js" }}"></script>
2 changes: 1 addition & 1 deletion docs/layouts/shortcodes/abs_url.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{ .Page.Site.BaseURL }}{{ .Get "link" }}
{{ absURL (.Get "link") }}
2 changes: 1 addition & 1 deletion docs/layouts/shortcodes/aida64_table.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $benchmarks := .Site.Data.benchmarks -}}
{{- $rows := index $benchmarks "aida64" }}
{{- $baseurl := print .Page.Site.BaseURL "/images/benchmarks" -}}
{{- $baseurl := absURL "/images/benchmarks" -}}

<table>
<thead>
Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/shortcodes/benchmark_carousel.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- $key := .Get "key" -}}
{{- $benchmarks := .Site.Data.benchmarks -}}
{{- $rows := index $benchmarks $key }}
{{- $baseurl := print .Page.Site.BaseURL "/images/benchmarks" -}}
{{- $baseurl := absURL "/images/benchmarks" -}}

<div class="carousel" key="{{ $key }}">
{{ range $rows }}
Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/shortcodes/gpuz_images.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $benchmarks := .Site.Data.benchmarks -}}
{{- $rows := index $benchmarks "gpuz" }}
{{- $baseurl := print .Page.Site.BaseURL "/images/benchmarks" -}}
{{- $baseurl := absURL "/images/benchmarks" -}}

<table>
<thead>
Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/shortcodes/pdf_link.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{- $pdf := index $pdfs $key -}}

<div class="hx-rounded hx-border hx-inline-flex hx-flex-row hx-px-2 hx-py-1 hx-align-middle hx-shadow">
<a class="hx-flex" href="{{ .Page.Site.BaseURL }}{{ $pdf.path }}">
<a class="hx-flex" href="{{ absURL $pdf.path }}">
<div style="width: 1.5rem; height: 1.5rem; margin-right: 0.25rem">
<span class="hx-font-semibold hx-gap-2 hx-text-gray-500 hover:hx-text-gray-900 dark:hx-text-neutral-200 dark:hover:hx-text-neutral-50">
{{ partial "utils/icon.html" (dict "name" "document") }}
Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/shortcodes/responsive_image.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{- $image := index $images $key -}}

<div class="responsive-image hx-rounded hx-border hx-mb-4 hx-shadow" style="{{ $style | safeCSS }}">
<img loading="lazy" decoding="async" src="{{ .Page.Site.BaseURL }}{{ $image.path }}" style="margin-top: 0rem; margin-bottom: 0rem"/>
<img loading="lazy" decoding="async" src="{{ absURL $image.path }}" style="margin-top: 0rem; margin-bottom: 0rem"/>
<div class="hx-text-center hx-my-2">
<i>{{ $image.description }}</i>
{{ with $image.source }}
Expand Down

0 comments on commit 0b7ccf6

Please sign in to comment.