Compare commits

...

5 Commits

Author SHA1 Message Date
Floren Munteanu
a5a3a08dcf
Merge 368c20e935eb96e9a6a5998c5a2941b9416b286c into fe2271b60bd34476726447fd9361aee59eb2a92f 2024-12-09 17:53:00 +03:30
Xin
fe2271b60b
docs(showcase): add "Model Context Protocol Specification"
Some checks failed
Deploy Hugo site to Pages / build (push) Has been cancelled
Deploy Hugo site to Pages / deploy (push) Has been cancelled
2024-12-08 12:38:44 +00:00
Torbjørn Pedersen
bd34a5bad3
fix: rerender mermaid diagrams on theme change (#509)
Make mermaid render diagrams on manual toggle between themes, after initial page load
2024-12-08 12:29:28 +00:00
Floren Munteanu
368c20e935 Implement header size 2024-05-17 15:29:39 -04:00
Floren Munteanu
9e684fa313 Implement hextra hero-section 2024-05-16 19:24:41 -04:00
3 changed files with 42 additions and 2 deletions

View File

@ -12,6 +12,13 @@ Open source projects powered by Hextra
</p>
{{< cards >}}
{{< card
link="https://github.com/modelcontextprotocol/specification"
title="Model Context Protocol Specification"
image="https://github.com/user-attachments/assets/1bb4f952-b8fc-43b5-9cbd-cd7213c2ba90"
imageStyle="object-fit:cover; aspect-ratio:16/9;"
>}}
{{< card
link="https://github.com/jonaspleyer/cellular_raza"
title="cellular_raza"
@ -84,7 +91,7 @@ Open source projects powered by Hextra
link="https://hoa.moe/"
title="HITSZ OpenAuto"
image="https://raw.githubusercontent.com/HITSZ-OpenAuto/hoa.moe/main/static/images/showcase-new.png"
imageStyle="object-fit:cover; aspect-ratio:16/9;"
imageStyle="object-fit:cover; aspect-ratio:16/9;"
>}}
{{< card

View File

@ -37,9 +37,32 @@
{{- $mermaidJS := resources.Get "lib/mermaid/mermaid.min.js" | fingerprint -}}
<script defer src="{{ $mermaidJS.RelPermalink }}" integrity="{{ $mermaidJS.Data.Integrity }}"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
document.addEventListener("DOMContentLoaded", () => {
// Store original mermaid code for each diagram
document.querySelectorAll(".mermaid").forEach(el => {
el.dataset.original = el.innerHTML;
});
const theme = document.documentElement.classList.contains("dark") ? "dark" : "default";
mermaid.initialize({ startOnLoad: true, theme: theme });
let timeout;
new MutationObserver(() => {
clearTimeout(timeout);
timeout = setTimeout(() => {
const theme = document.documentElement.classList.contains("dark") ? "dark" : "default";
document.querySelectorAll(".mermaid").forEach(el => {
// Reset to original content, preserving HTML
el.innerHTML = el.dataset.original;
el.removeAttribute("data-processed");
});
mermaid.initialize({ startOnLoad: true, theme: theme });
mermaid.init();
}, 150);
}).observe(document.documentElement, {
attributes: true,
attributeFilter: ["class"]
});
});
</script>
{{- end -}}

View File

@ -0,0 +1,10 @@
{{- $style := .Get "style" -}}
{{- $header := int (strings.TrimPrefix "h" (.Get "header" | default "h2")) -}}
{{- $size := cond (ge $header 4) "xl" (cond (eq $header 3) "2xl" "4xl") -}}
<h{{ $header }}
class="not-prose hx-text-{{ $size }} hx-font-bold hx-leading-none hx-tracking-tighter md:hx-text-3xl hx-py-2 hx-bg-clip-text hx-text-transparent hx-bg-gradient-to-r hx-from-gray-900 hx-to-gray-600 dark:hx-from-gray-100 dark:hx-to-gray-400"
{{ with $style }}style="{{ . | safeCSS }}"{{ end }}
>
{{ .Inner | markdownify }}
</h{{ $header }}>