mirror of
https://github.com/imfing/hextra.git
synced 2025-05-13 09:46:27 -04:00
Compare commits
5 Commits
ce817f4855
...
a5a3a08dcf
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a5a3a08dcf | ||
![]() |
fe2271b60b | ||
![]() |
bd34a5bad3 | ||
![]() |
368c20e935 | ||
![]() |
9e684fa313 |
@ -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"
|
||||
|
@ -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 -}}
|
||||
|
10
layouts/shortcodes/hextra/hero-section.html
Normal file
10
layouts/shortcodes/hextra/hero-section.html
Normal 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 }}>
|
Loading…
x
Reference in New Issue
Block a user