feat: add miller document layout

This commit is contained in:
2026-04-29 09:26:37 -04:00
parent 6e244d55db
commit 8c454de809
5 changed files with 333 additions and 72 deletions

View File

@@ -1,22 +1,58 @@
{{ define "document.gohtml" }}{{ template "base" . }}{{ end }}
{{ define "document_content" }}
<article class="document-shell" data-document-path="{{ .Path }}" data-document-hash="{{ .Hash }}">
<div class="document-meta">
<p class="eyebrow">{{ .Path }}</p>
<h1>{{ .Title }}</h1>
{{ if .Tags }}
<ul class="tag-list">
{{ range .Tags }}
<li><a href="/?tag={{ . }}">#{{ . }}</a></li>
<section class="workspace-shell">
{{ template "browser" .Browser }}
<article class="document-shell" data-document-path="{{ .Path }}" data-document-hash="{{ .Hash }}">
<div class="document-meta">
<h1>{{ .Title }}</h1>
<dl class="meta-grid">
<div>
<dt>File</dt>
<dd><code>{{ .Path }}</code></dd>
</div>
<div>
<dt>Hash</dt>
<dd><code>{{ .Hash }}</code></dd>
</div>
{{ if .Tags }}
<div>
<dt>Tags</dt>
<dd>
<ul class="tag-list">
{{ range .Tags }}
<li><a href="/?tag={{ . }}">#{{ . }}</a></li>
{{ end }}
</ul>
</dd>
</div>
{{ end }}
</dl>
</div>
<div class="markdown-body">
{{ .HTML }}
</div>
</article>
</section>
{{ end }}
{{ define "browser" }}
<nav class="miller-browser" aria-label="Documents">
{{ range .Columns }}
<section class="miller-column" aria-label="{{ .Title }}">
<h2>{{ .Title }}</h2>
<ul>
{{ range .Items }}
<li>
<a class="{{ if .Active }}is-active{{ end }} {{ if .IsFolder }}is-folder{{ end }}" href="{{ .URL }}">
<span>{{ .Name }}</span>
{{ if .IsFolder }}<span aria-hidden="true"></span>{{ end }}
</a>
</li>
{{ end }}
</ul>
{{ end }}
<p class="hash">SHA-256: <code>{{ .Hash }}</code></p>
</div>
<div class="markdown-body">
{{ .HTML }}
</div>
</article>
</section>
{{ end }}
</nav>
{{ end }}