feat: bootstrap foundation application
This commit is contained in:
32
apps/server/internal/httpserver/templates/base.gohtml
Normal file
32
apps/server/internal/httpserver/templates/base.gohtml
Normal 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 }}
|
||||
22
apps/server/internal/httpserver/templates/document.gohtml
Normal file
22
apps/server/internal/httpserver/templates/document.gohtml
Normal 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 }}
|
||||
9
apps/server/internal/httpserver/templates/error.gohtml
Normal file
9
apps/server/internal/httpserver/templates/error.gohtml
Normal 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 }}
|
||||
23
apps/server/internal/httpserver/templates/index.gohtml
Normal file
23
apps/server/internal/httpserver/templates/index.gohtml
Normal 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 }}
|
||||
Reference in New Issue
Block a user