Интернет-магазин: Go, PostgreSQL 17 SSL, Caddy, Docker Compose
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
{{define "home.html"}}
|
||||
{{template "layout" .}}
|
||||
{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<section class="hero">
|
||||
<div class="container hero-grid">
|
||||
<div class="hero-copy">
|
||||
<p class="eyebrow">Новая коллекция 2026</p>
|
||||
<h1 class="hero-title">Стиль, который<br><em>остаётся с вами</em></h1>
|
||||
<p class="hero-lead">Качественные товары с быстрой доставкой. В каталоге уже {{.TotalItems}} позиций.</p>
|
||||
<div class="hero-cta">
|
||||
<a href="#catalog" class="btn btn-primary btn-lg">Смотреть каталог</a>
|
||||
<a href="#categories" class="btn btn-ghost btn-lg">Категории</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hero-visual" aria-hidden="true">
|
||||
<div class="hero-card hero-card-a"></div>
|
||||
<div class="hero-card hero-card-b"></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{if .Categories}}
|
||||
<section id="categories" class="section categories">
|
||||
<div class="container">
|
||||
<h2 class="section-title">Категории</h2>
|
||||
<ul class="category-list">
|
||||
{{range .Categories}}
|
||||
<li><a href="#catalog" class="category-chip">{{.}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
||||
|
||||
<section id="catalog" class="section catalog">
|
||||
<div class="container">
|
||||
<div class="section-head">
|
||||
<h2 class="section-title">Популярные товары</h2>
|
||||
<p class="section-sub">Избранное из нашего ассортимента</p>
|
||||
</div>
|
||||
{{if .Products}}
|
||||
<div class="product-grid">
|
||||
{{range .Products}}
|
||||
<article class="product-card">
|
||||
<div class="product-image" style="background-image: url('{{.ImageURL}}')"></div>
|
||||
<div class="product-body">
|
||||
<span class="product-category">{{.Category}}</span>
|
||||
<h3 class="product-name">{{.Name}}</h3>
|
||||
<p class="product-desc">{{.Description}}</p>
|
||||
<div class="product-footer">
|
||||
<span class="product-price">{{formatPrice .Price}}</span>
|
||||
<button type="button" class="btn btn-primary btn-sm">В корзину</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
<p class="empty-state">Товары скоро появятся. Проверьте подключение к базе данных.</p>
|
||||
{{end}}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section features">
|
||||
<div class="container features-grid">
|
||||
<div class="feature">
|
||||
<h3>Быстрая доставка</h3>
|
||||
<p>Отправка в день заказа по всей России.</p>
|
||||
</div>
|
||||
<div class="feature">
|
||||
<h3>Гарантия качества</h3>
|
||||
<p>14 дней на возврат без лишних вопросов.</p>
|
||||
</div>
|
||||
<div class="feature">
|
||||
<h3>Безопасная оплата</h3>
|
||||
<p>Шифрование данных и защищённые платежи.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
||||
@@ -0,0 +1,39 @@
|
||||
{{define "layout"}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="ru">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{.Title}} — ShopNova</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Instrument+Serif:ital@0;1&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<header class="site-header">
|
||||
<div class="container header-inner">
|
||||
<a href="/" class="logo">Shop<span>Nova</span></a>
|
||||
<nav class="nav">
|
||||
<a href="/" class="nav-link active">Главная</a>
|
||||
<a href="#catalog" class="nav-link">Каталог</a>
|
||||
<a href="#categories" class="nav-link">Категории</a>
|
||||
</nav>
|
||||
<div class="header-actions">
|
||||
<button type="button" class="btn btn-ghost" aria-label="Поиск">Поиск</button>
|
||||
<button type="button" class="btn btn-primary">Корзина</button>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
{{template "content" .}}
|
||||
</main>
|
||||
<footer class="site-footer">
|
||||
<div class="container footer-inner">
|
||||
<p class="footer-brand">ShopNova</p>
|
||||
<p class="footer-copy">© 2026 Интернет-магазин. Go + PostgreSQL + Caddy.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user