Implements a Go-based CMS for editing Hugo posts and uploading images via the GitHub REST API, with no database and Git as the source of truth. Features: - Single admin auth with bcrypt password and signed session cookies - Dashboard, post listing with search, create/edit with EasyMDE editor - Media library for static/uploads/ with drag-drop and clipboard paste - Client-side autosave, unsaved changes warning, dark mode, responsive UI - Modular packages for auth, github, posts, media, session, and handlers Co-authored-by: codegirl007 <s.raide@gmail.com>
38 lines
1.2 KiB
HTML
38 lines
1.2 KiB
HTML
{{define "layout"}}
|
|
<!DOCTYPE html>
|
|
<html lang="en" data-theme="light">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{{.Title}} · Hugo CMS</title>
|
|
<link rel="stylesheet" href="/assets/css/app.css">
|
|
{{block "head" .}}{{end}}
|
|
</head>
|
|
<body>
|
|
{{if ne .Title "Login"}}
|
|
<nav class="topnav">
|
|
<a href="/admin" class="brand">Hugo CMS</a>
|
|
<div class="nav-links">
|
|
<a href="/admin" class="{{if eq .Active "dashboard"}}active{{end}}">Dashboard</a>
|
|
<a href="/admin/posts" class="{{if eq .Active "posts"}}active{{end}}">Posts</a>
|
|
<a href="/admin/media" class="{{if eq .Active "media"}}active{{end}}">Media</a>
|
|
</div>
|
|
<div class="nav-actions">
|
|
<button type="button" id="theme-toggle" class="btn-icon" title="Toggle dark mode" aria-label="Toggle dark mode">◐</button>
|
|
<form method="POST" action="/logout" class="inline-form">
|
|
<button type="submit" class="btn btn-ghost">Logout</button>
|
|
</form>
|
|
</div>
|
|
</nav>
|
|
{{end}}
|
|
|
|
<main class="container">
|
|
{{block "content" .}}{{end}}
|
|
</main>
|
|
|
|
<script src="/assets/js/app.js"></script>
|
|
{{block "scripts" .}}{{end}}
|
|
</body>
|
|
</html>
|
|
{{end}}
|