first commit
This commit is contained in:
67
templates/blog.html
Normal file
67
templates/blog.html
Normal file
@@ -0,0 +1,67 @@
|
||||
{{define "title"}}Build Log — Ridgway Systems{{end}}
|
||||
{{define "meta-desc"}}OpenBSD homelab build log — documenting decisions, problems, and solutions.{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<div class="page-header">
|
||||
<h1>Build Log</h1>
|
||||
<p class="page-desc">Documenting the OpenBSD homelab migration: what was built, how, and why.</p>
|
||||
</div>
|
||||
|
||||
<div class="blog-controls">
|
||||
<form action="/blog" method="GET" class="search-form" role="search">
|
||||
{{if .ActiveTag}}<input type="hidden" name="tag" value="{{.ActiveTag}}">{{end}}
|
||||
<input type="search" name="q" value="{{.SearchQuery}}" placeholder="Search posts…" aria-label="Search posts">
|
||||
<button type="submit" class="btn btn-sm">Search</button>
|
||||
{{if .SearchQuery}}<a href="/blog{{if .ActiveTag}}?tag={{.ActiveTag}}{{end}}" class="btn btn-sm btn-outline">Clear</a>{{end}}
|
||||
</form>
|
||||
|
||||
{{if .Tags}}
|
||||
<div class="tag-filter">
|
||||
<span class="tag-filter-label">filter:</span>
|
||||
<a href="/blog{{if .SearchQuery}}?q={{.SearchQuery}}{{end}}" class="tag{{if eq .ActiveTag ""}} tag-active{{end}}">#all</a>
|
||||
{{range .Tags}}
|
||||
<a href="/blog?tag={{.}}{{if $.SearchQuery}}&q={{$.SearchQuery}}{{end}}" class="tag{{if eq . $.ActiveTag}} tag-active{{end}}">#{{.}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{if and .SearchQuery (not .Posts)}}
|
||||
<p class="empty-state">No results for “{{.SearchQuery}}”. <a href="/blog">Clear search.</a></p>
|
||||
{{else if .Posts}}
|
||||
<ul class="post-list post-list-full">
|
||||
{{range .Posts}}
|
||||
<li class="post-item">
|
||||
<div class="post-meta">
|
||||
<span class="post-date">{{formatDate .ParsedDate}}</span>
|
||||
{{if .Draft}}<span class="draft-badge">draft</span>{{end}}
|
||||
</div>
|
||||
<a href="/blog/{{.Slug}}" class="post-title">{{.Title}}</a>
|
||||
{{if .Description}}<p class="post-desc">{{.Description}}</p>{{end}}
|
||||
{{if .Tags}}
|
||||
<span class="post-tags">
|
||||
{{range .Tags}}<a href="/blog?tag={{.}}" class="tag">#{{.}}</a> {{end}}
|
||||
</span>
|
||||
{{end}}
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
|
||||
{{if gt .TotalPages 1}}
|
||||
<nav class="pagination" aria-label="Page navigation">
|
||||
{{if .HasPrev}}
|
||||
<a href="/blog?page={{.PrevPage}}{{if .ActiveTag}}&tag={{.ActiveTag}}{{end}}{{if .SearchQuery}}&q={{.SearchQuery}}{{end}}" class="btn btn-outline btn-sm">← Newer</a>
|
||||
{{end}}
|
||||
<span class="page-indicator">page {{.Page}} of {{.TotalPages}}</span>
|
||||
{{if .HasNext}}
|
||||
<a href="/blog?page={{.NextPage}}{{if .ActiveTag}}&tag={{.ActiveTag}}{{end}}{{if .SearchQuery}}&q={{.SearchQuery}}{{end}}" class="btn btn-outline btn-sm">Older →</a>
|
||||
{{end}}
|
||||
</nav>
|
||||
{{end}}
|
||||
|
||||
{{else}}
|
||||
<p class="empty-state">No posts yet.
|
||||
{{if .ActiveTag}}Try <a href="/blog">removing the filter</a>.{{end}}
|
||||
</p>
|
||||
{{end}}
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user