feat: bootstrap foundation application

This commit is contained in:
2026-04-29 00:26:58 -04:00
parent 8e6646499f
commit 4a72e1e030
53 changed files with 4443 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
{{ define "base" }}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>{{ .Title }}</title>
<link rel="stylesheet" href="/static/site.css" />
</head>
<body class="{{ .BodyClass }}">
<header class="site-header">
<div class="site-header__inner">
<a class="site-brand" href="/">MD Hub Secure</a>
<nav class="site-nav">
<a href="/">Docs</a>
{{ if .WebEnabled }}<a href="/app/">App</a>{{ end }}
<a href="/health">Health</a>
</nav>
</div>
</header>
<main class="site-main">
{{ if eq .BodyTemplate "index_content" }}
{{ template "index_content" .Data }}
{{ else if eq .BodyTemplate "document_content" }}
{{ template "document_content" .Data }}
{{ else if eq .BodyTemplate "error_content" }}
{{ template "error_content" .Data }}
{{ end }}
</main>
</body>
</html>
{{ end }}

View File

@@ -0,0 +1,22 @@
{{ define "document.gohtml" }}{{ template "base" . }}{{ end }}
{{ define "document_content" }}
<article class="document-shell">
<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>
{{ end }}
</ul>
{{ end }}
<p class="hash">SHA-256: <code>{{ .Hash }}</code></p>
</div>
<div class="markdown-body">
{{ .HTML }}
</div>
</article>
{{ end }}

View File

@@ -0,0 +1,9 @@
{{ define "error.gohtml" }}{{ template "base" . }}{{ end }}
{{ define "error_content" }}
<section class="error-panel">
<p class="eyebrow">Error</p>
<h1>{{ .Status }}</h1>
<p>{{ .Message }}</p>
</section>
{{ end }}

View File

@@ -0,0 +1,23 @@
{{ 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>
{{ end }}