init wompum header image

This commit is contained in:
Drew
2025-03-06 22:09:53 -07:00
parent 0be059b269
commit 1a7f4521f5
11 changed files with 358 additions and 15 deletions

View File

@@ -6,6 +6,7 @@
{{ .Title }}
</title>
<meta name="description" content="{{ .Description }}" />
{{ partial "css-variables.html" . }}
{{/* styles */}}
{{ $options := dict "inlineImports" true }}
{{ $styles := resources.Get "css/styles.css" }}
@@ -14,6 +15,7 @@
{{ $styles = $styles | minify | fingerprint | resources.PostProcess }}
{{ end }}
<link href="{{ $styles.RelPermalink }}" rel="stylesheet" />
<link href="/css/wompum.css" rel="stylesheet" />
</head>
<body class="">
{{ partial "header.html" . }}

View File

@@ -1,17 +1,18 @@
{{ define "main" }}
<article class="flex flex-col lg:flex-row-reverse">
<header class="lg:sticky lg:top-0 lg:h-screen lg:overflow-y-auto lg:w-1/3 p-4">
<h1 class="font-bold">{{ .Title }}</h1>
<p><strong>Date:</strong> <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "January 2, 2006" }}</time></p>
<p><strong>Narrator:</strong> {{ .Params.narrator }}</p>
<p><strong>Facilitator:</strong> {{ .Params.facilitator }}</p>
<p><strong>Subject:</strong> {{ .Params.subject }}</p>
<p><strong>Tags:</strong> {{ partial "tags.html" . }}</p>
</header>
<div class="prose lg:prose-xl lg:w-2/3 p-4">
<p class="font-bold text-4xl">{{ .Title }}</p>
{{ .Content }}
</div>
</article>
<article class="flex flex-col lg:flex-row-reverse">
<header class="lg:sticky lg:top-0 lg:h-screen lg:overflow-y-auto lg:w-1/3 p-4">
<h1 class="font-bold">{{ .Title }}</h1>
<p><strong>Date:</strong> <time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "January 2, 2006" }}</time></p>
<p><strong>Narrator:</strong> {{ .Params.narrator }}</p>
<p><strong>Facilitator:</strong> {{ .Params.facilitator }}</p>
<p><strong>Subject:</strong> {{ .Params.subject }}</p>
<p><strong>Tags:</strong> {{ partial "tags.html" . }}</p>
</header>
<div class="prose lg:prose-xl lg:w-2/3 p-4">
{{ partial "article-wompum.html" . }}
<p class="font-bold text-4xl">{{ .Title }}</p>
{{ .Content }}
</div>
</article>
{{ end }}

View File

@@ -5,6 +5,7 @@
<ul class="flex flex-col gap-4 my-4">
{{ range where .Site.RegularPages "Section" "oral-histories" }}
<li class="border-l border-gray-300 pl-4">
{{ partial "article-wompum.html" . }}
<p class="text-xs text-gray-800"><time datetime="{{ .Date.Format " 2006-01-02" }}">{{ .Date.Format "January 2, 2006" }}</time></p>
<a class="font-bold hover:text-green-900 underline" href="{{ .RelPermalink }}">{{ .Title }}</a>
<p class="text-sm">{{ .Params.summary }}</p>

View File

@@ -0,0 +1,12 @@
<div class="wompum-container">
<div class="wompum-grid"
data-metadata="{{ jsonify .Params }}"
>
<!-- Grid will be populated by JavaScript -->
<!-- 7x5 = 35 cells total -->
</div>
</div>
<script src="/js/sigil.js"></script>
<script src="/js/colorCalculator.js"></script>
<script src="/js/wompum.js"></script>

View File

@@ -0,0 +1,9 @@
<style>
:root {
{{ range $colorName, $shades := site.Data.colors }}
{{ range $shade, $value := $shades }}
--{{ $colorName }}-{{ $shade }}: {{ $value }};
{{ end }}
{{ end }}
}
</style>

View File

@@ -0,0 +1,25 @@
{{/* Partial: create_sigil.html */}}
{{- $input := . -}} <!-- The input string will be passed into the partial -->
{{- $vowels := "aeiouAEIOU" -}} <!-- List of vowels to remove -->
{{- $seen := dict -}} <!-- Dictionary to track characters we've already encountered -->
{{- $output := "" -}} <!-- Variable to store the resulting sigil -->
{{- $chars := split (replaceRE "[^a-zA-Z]" "" $input) "" -}} <!-- Remove non-alphabetic characters and split the input string into a slice of characters -->
{{- /* Step 1: Remove vowels */ -}}
{{- range $i, $char := $chars -}}
{{- if not (in $vowels $char) -}}
{{- /* Step 2: Remove repeating letters */ -}}
{{- if not (index $seen $char) -}}
{{- $seen = merge $seen (dict $char true) -}}
{{- $output = printf "%s%s" $output $char -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $output = upper $output -}}
{{ $output = split $output "" }}
{{ $output = apply $output "printf" "%#x" "." }}
{{ $output = apply $output "int" "." }}
{{- $output -}}<br>