Skip to content

Commit be2172f

Browse files
author
Tim Bannister
committed
Ready sortable table support for Docsy
- make the JavaScript an asset - add it to the head-end hook rather than the head partial itself
1 parent 068ec93 commit be2172f

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed
File renamed without changes.

layouts/partials/head.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@
8787
<script defer src="{{ "js/dismiss_banner.js" | relURL }}"></script>
8888

8989

90-
{{- if or (.HasShortcode "table") (.HasShortcode "feature-gate-table") -}}
91-
<script defer src="{{ "js/sortable-table.js" | relURL }}"></script>
92-
{{- end -}}
93-
9490
{{- if .HasShortcode "release-binaries" -}}
9591
<script defer src="{{ "js/release_binaries.js" | relURL }}"></script>
9692
{{- end -}}

layouts/partials/hooks/head-end.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
<link rel="manifest" href="/manifest.webmanifest">
2+
3+
{{- if or (.HasShortcode "table") (.HasShortcode "feature-gate-table") -}}
4+
{{- if hugo.IsProduction -}}
5+
{{- $sortableTableJs := resources.Get "js/sortable-table.js" | minify | fingerprint -}}
6+
<script defer src="{{ $sortableTableJs.RelPermalink }}" integrity="{{ $sortableTableJs.Data.Integrity }}" crossorigin="anonymous"></script>
7+
{{- else -}}
8+
{{- $sortableTableJs := resources.Get "js/sortable-table.js" -}}
9+
<script defer src="{{ $sortableTableJs.RelPermalink }}"></script>
10+
{{- end -}}
11+
{{- end -}}

0 commit comments

Comments
 (0)