lookbook/internal/components/page.go
soup cdcc5b5293
Initial commit: Lookbook personal collection app
Pinterest-like app for saving images, videos, quotes, and embeds.

Features:
- Go backend with PostgreSQL, SSR templates
- Console-based admin auth (login/logout via browser console)
- Item types: images, videos (ffmpeg transcoding), quotes, embeds
- Media stored as BLOBs in PostgreSQL
- OpenGraph metadata extraction for links
- Embed detection for YouTube, Vimeo, Twitter/X
- Masonry grid layout, item detail pages
- Tag system with filtering
- Refresh metadata endpoint with change warnings
- Replace media endpoint for updating item images/videos
2026-01-17 01:09:23 -05:00

43 lines
799 B
Go

package components
import (
"git.soup.land/soup/sxgo/ssr"
)
type Page struct {
Title string
IsAdmin bool
Content ssr.Renderable
}
func (p Page) Render(sw *ssr.Writer) error {
sw.Tmpl(p, `
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{if .Title}}{{.Title}} - {{end}}Lookbook</title>
<link rel="stylesheet" href="{{staticURL "css/app.css"}}">
</head>
<body>
<header class="header">
<a href="/" class="logo">LOOKBOOK</a>
<nav class="nav">
<a href="/">ALL</a>
</nav>
</header>
<main class="main">
`)
p.Content.Render(sw)
return sw.Tmpl(p, `
</main>
<script src="{{staticURL "js/app.js"}}"></script>
<script>
window.IS_ADMIN = {{.IsAdmin}};
</script>
</body>
</html>
`)
}