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 }}

View File

@@ -1,23 +1,11 @@
{{ define "index.gohtml" }}{{ template "base" . }}{{ end }}
{{ define "index_content" }}
<section class="hero-panel">
<p class="eyebrow">Foundation</p>
<h1>Server-rendered Markdown, secure attachments, and a clean base for sync.</h1>
<p class="lede">This milestone focuses on a fast read path. Documents are synchronized from the content directory into content-addressed storage and rendered to HTML on demand.</p>
</section>
<section class="doc-list">
<h2>Documents</h2>
<ul>
{{ range .Documents }}
<li>
<a href="/docs/{{ trimMd .Path }}">{{ .Title }}</a>
<code>{{ .Path }}</code>
</li>
{{ else }}
<li>No documents found.</li>
{{ end }}
</ul>
<section class="workspace-shell workspace-shell--empty">
{{ template "browser" .Browser }}
<section class="empty-preview">
<p class="eyebrow">Documents</p>
<h1>MD Hub Secure</h1>
</section>
</section>
{{ end }}