mirror of
https://github.com/imfing/hextra.git
synced 2025-09-16 19:46:46 -04:00
Merge branch 'main' into image-zoom
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -33,19 +33,19 @@
|
|||||||
@apply hx:border-black/4 hx:bg-black/3 hx:break-words hx:rounded-md hx:border hx:py-0.5 hx:px-[.25em] hx:text-[.9em] hx:dark:border-white/10 hx:dark:bg-white/10;
|
@apply hx:border-black/4 hx:bg-black/3 hx:break-words hx:rounded-md hx:border hx:py-0.5 hx:px-[.25em] hx:text-[.9em] hx:dark:border-white/10 hx:dark:bg-white/10;
|
||||||
}
|
}
|
||||||
:where(table):not(:where(.hextra-code-block table, [class~=not-prose],[class~=not-prose] *)) {
|
:where(table):not(:where(.hextra-code-block table, [class~=not-prose],[class~=not-prose] *)) {
|
||||||
@apply hx:block hx:overflow-x-auto hx:my-6 hx:p-0 hx:first:mt-0 hx:w-full hx:text-sm hx:leading-5;
|
@apply hx:block hx:overflow-x-auto hx:my-6 hx:p-0 hx:first:mt-0 hx:w-full hx:text-sm hx:leading-5 hx:border-collapse;
|
||||||
|
|
||||||
thead {
|
thead {
|
||||||
@apply hx:border-b hx:border-gray-200 hx:dark:border-neutral-800;
|
@apply hx:bg-gray-50 hx:dark:bg-gray-600/20;
|
||||||
}
|
}
|
||||||
tbody tr {
|
tr {
|
||||||
@apply hx:m-0 hx:border-b hx:border-gray-100 hx:dark:border-neutral-800/50;
|
@apply hx:m-0 hx:border-t hx:border-gray-300 hx:p-0 hx:dark:border-gray-600;
|
||||||
}
|
}
|
||||||
th {
|
th {
|
||||||
@apply hx:m-0 hx:p-2 hx:font-semibold hx:first:pl-0 hx:last:pr-0;
|
@apply hx:m-0 hx:border hx:border-gray-300 hx:p-2 hx:font-semibold hx:dark:border-gray-600;
|
||||||
}
|
}
|
||||||
td {
|
td {
|
||||||
@apply hx:m-0 hx:p-2 hx:first:pl-0 hx:last:pr-0;
|
@apply hx:m-0 hx:border hx:border-gray-300 hx:p-2 hx:dark:border-gray-600;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
:where(ol):not(:where([class~=not-prose],[class~=not-prose] *)) {
|
:where(ol):not(:where([class~=not-prose],[class~=not-prose] *)) {
|
||||||
|
6
assets/js/head/banner.js
Normal file
6
assets/js/head/banner.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
// The section must not be in the banner.js (body) file because it can create a quick flash.
|
||||||
|
|
||||||
|
if (localStorage.getItem('{{ site.Params.banner.key | default `banner-closed` }}')) {
|
||||||
|
document.documentElement.style.setProperty("--hextra-banner-height", "0px");
|
||||||
|
document.documentElement.classList.add("hextra-banner-hidden");
|
||||||
|
}
|
14
assets/js/head/theme.js
Normal file
14
assets/js/head/theme.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
// The section must not be in the theme.js (body) file because it can create a quick flash (switch between light and dark).
|
||||||
|
|
||||||
|
function setTheme(theme) {
|
||||||
|
document.documentElement.classList.remove("light", "dark");
|
||||||
|
|
||||||
|
if (theme !== "light" && theme !== "dark") {
|
||||||
|
theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
||||||
|
}
|
||||||
|
|
||||||
|
document.documentElement.classList.add(theme);
|
||||||
|
document.documentElement.style.colorScheme = theme;
|
||||||
|
}
|
||||||
|
|
||||||
|
setTheme("color-theme" in localStorage ? localStorage.getItem("color-theme") : '{{ site.Params.theme.default | default `system`}}')
|
@@ -419,7 +419,7 @@ params:
|
|||||||
umami:
|
umami:
|
||||||
serverURL: "https://example.com"
|
serverURL: "https://example.com"
|
||||||
websiteID: "94db1cb1-74f4-4a40-ad6c-962362670409"
|
websiteID: "94db1cb1-74f4-4a40-ad6c-962362670409"
|
||||||
# scriptName: "umami.js" # optional (default: umami.js)
|
# scriptName: "script.js" # optional (default: script.js)
|
||||||
# https://umami.is/docs/tracker-configuration#data-host-url
|
# https://umami.is/docs/tracker-configuration#data-host-url
|
||||||
# hostURL: "http://stats.example.org" # optional
|
# hostURL: "http://stats.example.org" # optional
|
||||||
# https://umami.is/docs/tracker-configuration#data-auto-track
|
# https://umami.is/docs/tracker-configuration#data-auto-track
|
||||||
|
@@ -116,7 +116,6 @@ menu:
|
|||||||
params:
|
params:
|
||||||
type: link
|
type: link
|
||||||
icon: beaker
|
icon: beaker
|
||||||
parent: versions
|
|
||||||
- identifier: v0.10
|
- identifier: v0.10
|
||||||
name: v0.10 ↗
|
name: v0.10 ↗
|
||||||
url: https://imfing.github.io/hextra/versions/v0.10/
|
url: https://imfing.github.io/hextra/versions/v0.10/
|
||||||
|
@@ -15,7 +15,7 @@ https://umami.is/docs/tracker-configuration
|
|||||||
|
|
||||||
{{- $attributes := newScratch -}}
|
{{- $attributes := newScratch -}}
|
||||||
|
|
||||||
{{- $attributes.SetInMap "umami" "src" (printf "%s/%s" .serverURL (.scriptName | default "umami.js")) -}}
|
{{- $attributes.SetInMap "umami" "src" (printf "%s/%s" .serverURL (.scriptName | default "script.js")) -}}
|
||||||
{{- $attributes.SetInMap "umami" "data-website-id" .websiteID -}}
|
{{- $attributes.SetInMap "umami" "data-website-id" .websiteID -}}
|
||||||
|
|
||||||
{{- if .hostURL -}}
|
{{- if .hostURL -}}
|
||||||
|
@@ -55,32 +55,17 @@
|
|||||||
|
|
||||||
{{ partial "components/analytics/analytics.html" . }}
|
{{ partial "components/analytics/analytics.html" . }}
|
||||||
|
|
||||||
<script>
|
{{- $scriptsHead := slice -}}
|
||||||
// The section must not be in the theme.js file because it can create a quick flash (switch between light and dark).
|
{{- range resources.Match "js/head/*.js" -}}
|
||||||
|
{{ $scriptsHead = $scriptsHead | append (resources.ExecuteAsTemplate .Name $ .) }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
function setTheme(theme) {
|
{{- $scripts := $scriptsHead | resources.Concat "js/main-head.js" -}}
|
||||||
document.documentElement.classList.remove("light", "dark");
|
|
||||||
|
|
||||||
if (theme !== "light" && theme !== "dark") {
|
{{- if hugo.IsProduction -}}
|
||||||
theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
{{- $scripts = $scripts | minify | fingerprint -}}
|
||||||
}
|
{{- end -}}
|
||||||
|
<script src="{{ $scripts.RelPermalink }}" integrity="{{ $scripts.Data.Integrity }}"></script>
|
||||||
document.documentElement.classList.add(theme);
|
|
||||||
document.documentElement.style.colorScheme = theme;
|
|
||||||
}
|
|
||||||
|
|
||||||
setTheme("color-theme" in localStorage ? localStorage.getItem("color-theme") : '{{ site.Params.theme.default | default `system`}}')
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
// The section must not be in the banner.js file because it can create a quick flash.
|
|
||||||
|
|
||||||
if (localStorage.getItem('{{ site.Params.banner.key | default `banner-closed` }}')) {
|
|
||||||
document.documentElement.style.setProperty("--hextra-banner-height", "0px");
|
|
||||||
document.documentElement.classList.add("hextra-banner-hidden");
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<!-- Math engine -->
|
<!-- Math engine -->
|
||||||
{{ $noop := .WordCount -}}
|
{{ $noop := .WordCount -}}
|
||||||
|
@@ -1,18 +1,9 @@
|
|||||||
{{- $jsSwitcherMenu := resources.Get "js/switcher-menu.js" -}}
|
{{- $scriptsBody := slice }}
|
||||||
{{- $jsTheme := resources.Get "js/theme.js" | resources.ExecuteAsTemplate "theme.js" . -}}
|
{{- range resources.Match "js/core/*.js" -}}
|
||||||
{{- $jsBanner := resources.Get "js/banner.js" | resources.ExecuteAsTemplate "banner.js" . -}}
|
{{ $scriptsBody = $scriptsBody | append (resources.ExecuteAsTemplate .Name $ .) }}
|
||||||
{{- $jsMenu := resources.Get "js/menu.js" -}}
|
{{- end -}}
|
||||||
{{- $jsTabs := resources.Get "js/tabs.js" -}}
|
|
||||||
{{- $jsLang := resources.Get "js/lang.js" -}}
|
|
||||||
{{- $jsNavMenu := resources.Get "js/nav-menu.js" -}}
|
|
||||||
{{- $jsCodeCopy := resources.Get "js/code-copy.js" -}}
|
|
||||||
{{- $jsFileTree := resources.Get "js/filetree.js" -}}
|
|
||||||
{{- $jsSidebar := resources.Get "js/sidebar.js" -}}
|
|
||||||
{{- $jsBackToTop := resources.Get "js/back-to-top.js" -}}
|
|
||||||
{{- $jsTocScroll := resources.Get "js/toc-scroll.js" -}}
|
|
||||||
{{- $jsFavicon := resources.Get "js/favicon.js" | resources.ExecuteAsTemplate "favicon.js" . -}}
|
|
||||||
|
|
||||||
{{- $scripts := slice $jsSwitcherMenu $jsTheme $jsBanner $jsMenu $jsCodeCopy $jsTabs $jsLang $jsNavMenu $jsFileTree $jsSidebar $jsBackToTop $jsTocScroll $jsFavicon | resources.Concat "js/main.js" -}}
|
{{- $scripts := $scriptsBody | resources.Concat "js/main.js" -}}
|
||||||
{{- if hugo.IsProduction -}}
|
{{- if hugo.IsProduction -}}
|
||||||
{{- $scripts = $scripts | minify | fingerprint -}}
|
{{- $scripts = $scripts | minify | fingerprint -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
Reference in New Issue
Block a user