Files
codegirl.games-hugo/cms/internal/templates/templates/media.html
Cursor Agentandcodegirl007 ce15f54a52 Add lightweight self-hosted Hugo CMS with GitHub API backend
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>
2026-07-06 18:56:17 +00:00

37 lines
1.0 KiB
HTML

{{template "layout" .}}
{{define "content"}}
<div class="page-header">
<h1>Media Library</h1>
</div>
<section class="card">
<form id="media-upload-form" class="upload-form" enctype="multipart/form-data">
<input type="file" id="media-file" name="file" accept="image/*" required>
<button type="submit" class="btn btn-primary">Upload Image</button>
<span id="upload-status" class="save-status"></span>
</form>
</section>
<section class="card">
<h2>Uploaded Images</h2>
{{if .Items}}
<div class="media-grid media-grid-page">
{{range .Items}}
<div class="media-item">
<img src="{{.URL}}" alt="{{.Name}}" loading="lazy">
<div class="media-meta">
<code>{{.Name}}</code>
<button type="button" class="btn btn-ghost btn-sm copy-md" data-url="{{.URL}}">Copy Markdown</button>
</div>
</div>
{{end}}
</div>
{{else}}
<p class="empty-state">No images uploaded yet.</p>
{{end}}
</section>
{{end}}
{{define "scripts"}}
<script src="/assets/js/media.js"></script>
{{end}}