基本样式测试

This commit is contained in:
2025-11-23 21:48:11 +08:00
parent 86b28ed215
commit a469da2904
8 changed files with 126 additions and 90 deletions

View File

@@ -0,0 +1,17 @@
{{ define "layout/base.html" }}
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>{{ block "title" . }}默认标题{{ end }}</title>
<link rel="stylesheet" href="/static/style.css">
</head>
<body>
{{ template "layout/navbar.html" . }}
<main>
{{ block "content" . }}{{ end }}
</main>
</body>
</html>
{{ end }}

View File

@@ -0,0 +1,11 @@
{{ define "layout/navbar.html" }}
<nav class="navbar">
<div class="logo">🔥 NanNanWu</div>
<ul class="nav-links">
<li><a href="/">首页</a></li>
<li><a href="/about">关于我们</a></li>
<li><a href="/articles">文章</a></li>
<li><a href="/contact">联系</a></li>
</ul>
</nav>
{{ end }}