Files
codex-obscura-hugo-theme/layouts/index.html
2026-03-24 20:30:43 -04:00

134 lines
4.2 KiB
HTML

{{ define "main" }}
<!-- Cozy Hero Card -->
<section class="hero">
<div class="hero__card pixel-border">
<!-- Pixel art book/tea illustration -->
<div class="hero__pixel-art" aria-hidden="true">
<img src="profile_pic.png" width=250 height=250>
</div>
<div class="hero__info">
<!-- Name bar -->
<div class="hero__name-bar pixel-border">
<span class="label">SCHOLAR:</span>
<span class="value">{{ .Site.Params.author | default "archivist" }}</span>
<span class="label" style="margin-left:auto;">STATUS:</span>
<span class="value" style="color:var(--forest-light);">reading</span>
</div>
<!-- Status pips -->
<div class="hero__status">
<span style="color:var(--text-dim);">TEA:</span>
<span class="pip"></span>
<span class="pip"></span>
<span class="pip"></span>
<span class="pip"></span>
<span class="pip--dim pip"></span>
&nbsp;&nbsp;
<span style="color:var(--text-dim);">WHIMSY:</span>
<span class="pip"></span>
<span class="pip"></span>
<span class="pip"></span>
<span class="pip"></span>
<span class="pip"></span>
</div>
<!-- Description -->
<p class="hero__desc">
{{- with .Site.Params.description -}}
{{ . }}
{{- else -}}
A wanderer in the archive. Keeper of fragments, collector of marginalia.
Pull up a chair. The kettle is on.
{{- end -}}
</p>
<!-- Post count -->
<div style="font-family:var(--font-terminal); font-size:0.92rem; color:var(--text-dim);">
<span style="color:var(--forest-light);">entries:</span>
{{ len .Site.RegularPages }}
&nbsp;
{{- with .Site.Taxonomies.tags }}
<span style="color:var(--forest-light);">topics:</span>
{{ len . }}
{{- end }}
</div>
</div>
</div><!-- /.hero__card -->
<!--<div class="hero__cta">
<a href="{{ "posts/" | relURL }}" class="btn btn--primary">
[ open archive ]
</a>
<a href="{{ "about/" | relURL }}" class="btn btn--secondary">
[ about ]
</a>
</div> -->
</section>
<!-- Content + Sidebar Grid -->
<div class="content-grid">
<main id="main-content">
{{- $pinned := where .Site.RegularPages "Params.featured" true }}
{{- $recent := first 8 (where .Site.RegularPages "Params.featured" "!=" true) }}
{{- $posts := $recent }}
{{- if $pinned }}
{{- $posts = union $pinned $recent }}
{{- end }}
{{- if $posts }}
<ul class="post-list">
{{- range $i, $post := first 2 $posts }}
<li class="post-card pixel-border" data-index="{{ printf "%03d" (add $i 1) }}">
<div class="post-card__meta">
<span class="prompt">~/posts $</span>
<span class="post-card__date">{{ $post.Date.Format "2006-01-02" }}</span>
{{- if $post.Params.featured }}
<span style="color:var(--amber); font-size:0.8em;">[FEATURED]</span>
{{- end }}
</div>
<h2 class="post-card__title">
<a href="{{ $post.Permalink }}">{{ $post.Title }}</a>
</h2>
{{- with $post.Summary }}
<p class="post-card__summary">{{ . }}</p>
{{- end }}
{{- with $post.Params.tags }}
<div class="post-card__tags">
{{- range . }}
<a href="{{ "tags/" | relURL }}{{ . | urlize }}/" class="tag">{{ . }}</a>
{{- end }}
</div>
{{- end }}
</li>
{{- end }}
</ul>
{{- else }}
<div class="pixel-border" style="padding:2rem; font-family:var(--font-terminal); color:var(--text-dim); text-align:center;">
<p>// No entries found. The archive awaits its first manuscript.</p>
</div>
{{- end }}
{{- if gt (len .Site.RegularPages) 2 }}
<div style="margin-top:1.5rem; text-align:center;">
<a href="{{ "posts/" | relURL }}" class="btn btn--secondary">[ view all entries ]</a>
</div>
{{- end }}
</main>
{{ partial "sidebar.html" . }}
</div>
{{ end }}