Initial commit for Hugo site.

This commit is contained in:
Charish Patel
2025-02-20 08:28:31 -05:00
parent 737c448252
commit 045d0c24f3
696 changed files with 91218 additions and 0 deletions
@@ -0,0 +1,18 @@
<!-- To automatically render mermaid diagrams -->
{{ if ne (.Page.Scratch.Get "hasMermaid") true }}
<script type="module">
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs';
const lsTheme = localStorage.getItem("theme")
const hugoTheme = document.body.classList.contains("dark-theme") ? "dark" : null
const currTheme = lsTheme ? lsTheme : hugoTheme;
const mermaidTheme = currTheme == "light" ? "default" : "dark"
mermaid.initialize({theme: mermaidTheme});
</script>
{{ .Page.Scratch.Set "hasMermaid" true }}
{{ end }}
<div class="mermaid">
{{- .Inner | safeHTML }}
</div>
@@ -0,0 +1,13 @@
<!-- Locally hosted code for PlantUML diagrams -->
{{ if ne (.Page.Scratch.Get "hasPlantUML") true }}
{{ $js_bundle :=
slice
(resources.Get "js/lib/plantuml-encoder.js")
(resources.Get "js/plantuml-encoder.js")
| resources.Concat "js/plantuml-bundle.js" | minify | fingerprint }}
<script language="javascript" type="text/javascript" src="{{ $js_bundle.RelPermalink }}"></script>
{{ .Page.Scratch.Set "hasPlantUML" true }}
{{ end }}
<span id="plantuml-{{ .Get "id" }}" style="display:none">{{ .Inner | safeHTML | htmlUnescape }}</span>
<img class="plantuml" id="plantuml-{{ .Get "id" }}">
@@ -0,0 +1,6 @@
{{ $tabName := .Get "tabName" }}
{{ $tabContent := .Inner }}
{{ $tabID := delimit (shuffle (slice "a" "b" "c" "d" "e" "f")) "" }}
{{ .Parent.Scratch.Add "tabName" (slice $tabName) }}
{{ .Parent.Scratch.Add "tabContent" (slice $tabContent) }}
{{ .Parent.Scratch.Add "tabID" (slice $tabID) }}
@@ -0,0 +1,37 @@
{{ $tabTotal := .Get "tabTotal" }}
{{ $tabName := .Scratch.Get "tabName" }}
{{ $tabContent := .Scratch.Get "tabContent" }}
{{ $tabID := .Scratch.Get "tabID" }}
<div class="tabs-container">
<div class="tabs" role="tablist">
{{ range $i, $sequence := (seq $tabTotal) }}
{{ if eq $i 0 }}
<button class="tab active" id="{{ (index $tabID $i) }}">
{{ else }}
<button class="tab" id="{{ (index $tabID $i) }}">
{{ end }}
{{ index $tabName $i }}
</button>
{{ end }}
</div>
{{ range $i, $sequence := (seq $tabTotal) }}
{{ if eq $i 0 }}
<div class="tabcontent {{ (index $tabID $i) }}" style="display:block;">
{{ else }}
<div class="tabcontent {{ (index $tabID $i) }}">
{{ end }}
{{ (index $tabContent $i) }}
{{ if $.Inner }}
{{ end }}
</div>
{{ end }}
</div>