Rebuild site with Hugo: unified dark theme, SVG logo, data-driven content

This commit is contained in:
2026-07-08 16:14:01 +08:00
parent 0eaec96b68
commit 1214e48733
47 changed files with 1169 additions and 2766 deletions
+11
View File
@@ -0,0 +1,11 @@
{{ define "body" }}
<section class="error-page">
<div class="error-content">
<img src="{{ .Site.Params.logo }}" alt="Logo" class="error-logo" width="120" height="120">
<h1>404</h1>
<p>请求的页面未找到</p>
<p class="error-hint">请检查 URL 是否正确</p>
<a href="/" class="btn btn-primary">返回主页</a>
</div>
</section>
{{ end }}
+21
View File
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="{{ .Site.Language.Locale }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} — {{ .Site.Title }}{{ end }}</title>
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ .Site.Params.description }}{{ end }}">
<link rel="icon" href="/logo.svg" type="image/svg+xml">
{{ with .Params.accent }}<meta name="theme-color" content="{{ . }}">{{ end }}
<link rel="stylesheet" href="/css/style.css">
{{ block "extra_head" . }}{{ end }}
</head>
<body class="{{ if .IsHome }}home{{ else }}page{{ end }}">
{{ partial "nav.html" . }}
<main id="main-content">
{{ block "body" . }}{{ end }}
</main>
{{ partial "footer.html" . }}
{{ block "extra_scripts" . }}{{ end }}
</body>
</html>
+9
View File
@@ -0,0 +1,9 @@
{{ define "body" }}
<section class="page-hero" {{ with .Params.accent }}style="--accent: {{ . }}"{{ end }}>
<h1>{{ .Title }}</h1>
{{ with .Description }}<p class="subtitle">{{ . }}</p>{{ end }}
</section>
<section class="page-content container">
{{ .Content }}
</section>
{{ end }}
+9
View File
@@ -0,0 +1,9 @@
{{ define "body" }}
<section class="page-hero" {{ with .Params.accent }}style="--accent: {{ . }}"{{ end }}>
<h1>{{ .Title }}</h1>
{{ with .Params.subtitle }}<p class="subtitle">{{ . }}</p>{{ end }}
</section>
<section class="page-content container">
{{ .Content }}
</section>
{{ end }}
+22
View File
@@ -0,0 +1,22 @@
{{ define "body" }}
<div id="star-canvas-wrap">
<canvas id="star-canvas"></canvas>
<div class="home-overlay">
<div class="logo-wrap">
<img src="{{ .Site.Params.logo }}" alt="SNOWARE Logo" class="home-logo" width="180" height="180">
</div>
<h1 class="home-title">SNOWARE</h1>
<nav class="home-nav">
{{ range .Site.Params.navLinks }}
<a href="{{ .url }}" class="home-btn{{ if .external }} external{{ end }}" {{ if .external }}target="_blank" rel="noopener"{{ end }}>
{{ .name }}
</a>
{{ end }}
</nav>
</div>
</div>
{{ end }}
{{ define "extra_scripts" }}
<script src="/js/stars.js"></script>
{{ end }}
+5
View File
@@ -0,0 +1,5 @@
<footer class="site-footer">
<div class="container">
<p>{{ .Site.Copyright }}</p>
</div>
</footer>
+13
View File
@@ -0,0 +1,13 @@
<header class="site-nav">
<div class="nav-inner container">
<a href="/" class="nav-brand">
<img src="{{ .Site.Params.logo }}" alt="{{ .Site.Title }}" class="nav-logo" width="32" height="32">
<span>{{ .Site.Title }}</span>
</a>
<nav class="nav-links">
{{ range .Site.Params.navLinks }}
<a href="{{ .url }}" {{ if .external }}target="_blank" rel="noopener"{{ end }}>{{ .name }}</a>
{{ end }}
</nav>
</div>
</header>
+12
View File
@@ -0,0 +1,12 @@
<a href="{{ .demo_url }}" class="project-card" style="--accent: {{ .accent }}">
<div class="card-header">
<h3>{{ .name }}</h3>
<div class="card-tags">
{{ range .tags }}<span class="tag">{{ . }}</span>{{ end }}
</div>
</div>
<p class="card-desc">{{ .description }}</p>
<div class="card-links">
<span class="card-link primary">查看详情 →</span>
</div>
</a>
+11
View File
@@ -0,0 +1,11 @@
<a href="{{ .url }}" class="subject-card" target="_blank" rel="noopener" style="--color: {{ .color }}">
<div class="subject-icon">
<svg viewBox="0 0 24 24" width="40" height="40" fill="none" stroke="currentColor" stroke-width="1.5">
<path d="M3 7v10a2 2 0 002 2h14a2 2 0 002-2V7"/>
<path d="M21 7a2 2 0 00-2-2H5a2 2 0 00-2 2"/>
<path d="M12 5v14"/>
</svg>
</div>
<h3>{{ .name }}</h3>
<p class="subject-pw">密码: <code>{{ .password }}</code></p>
</a>
+13
View File
@@ -0,0 +1,13 @@
{{ define "body" }}
<section class="page-hero" style="--accent: #1565c0">
<h1>学科资源列表</h1>
<p class="subtitle">蓝奏云下载 · 点击学科即可跳转</p>
</section>
<section class="page-content container">
<div class="filelist-grid">
{{ range hugo.Data.subjects.subjects }}
{{ partial "subject-card.html" . }}
{{ end }}
</div>
</section>
{{ end }}
+34
View File
@@ -0,0 +1,34 @@
{{ define "body" }}
<section class="page-hero" style="--accent: #1565c0">
<h1>{{ .Title }}</h1>
<p class="subtitle">{{ .Description }}</p>
</section>
<section class="page-content container">
<div class="res-intro">
<p class="res-intro-text">{{ .Content }}</p>
</div>
<div class="res-actions">
<a href="/res/filelist/" class="btn btn-primary btn-lg">下载源:蓝奏云</a>
<a href="https://www.alipan.com/s/RMfnGxo6Z9D" class="btn btn-accent btn-lg external" target="_blank" rel="noopener">阿里云盘(需登录)</a>
</div>
<div class="res-features">
<div class="feature-card">
<div class="feature-icon">📋</div>
<h3>查漏补缺</h3>
<p>针对性复习薄弱知识点</p>
</div>
<div class="feature-card">
<div class="feature-icon">🔄</div>
<h3>习题重练</h3>
<p>反复练习巩固学习成果</p>
</div>
<div class="feature-card">
<div class="feature-icon">📖</div>
<h3>预习复习</h3>
<p>提前预习,高效复习</p>
</div>
</div>
</section>
{{ end }}
+18
View File
@@ -0,0 +1,18 @@
{{ define "body" }}
<section class="page-hero" style="--accent: #009688">
<h1>{{ .Title }}</h1>
<p class="subtitle">{{ .Description }}</p>
</section>
<section class="page-content container">
<div class="about-intro">
<p>S.A. (@snoware) — 开源爱好者,Rust / Ruby 开发者。致力于构建实用、安全、优雅的命令行工具与服务端软件。</p>
<a href="https://gitee.com/snoware" class="btn btn-accent external" target="_blank" rel="noopener">Gitee 主页</a>
</div>
<div class="project-grid">
{{ range hugo.Data.projects.projects }}
{{ partial "project-card.html" . }}
{{ end }}
</div>
</section>
{{ end }}
+82
View File
@@ -0,0 +1,82 @@
{{ define "body" }}
{{ $slug := .Params.project }}
{{ $matched := where hugo.Data.projects.projects "slug" $slug }}
{{ with index $matched 0 }}
<section class="page-hero" style="--accent: {{ .accent }}">
<h1>{{ .name }}</h1>
<p class="subtitle">{{ .description }}</p>
</section>
<section class="page-content container">
<!-- Links -->
<div class="sw-links">
<a href="{{ .repo_url }}" class="btn btn-accent external" target="_blank" rel="noopener">Gitee 源码</a>
{{ with .doc_url }}<a href="{{ . }}" class="btn btn-outline external" target="_blank" rel="noopener">文档</a>{{ end }}
{{ if eq .slug "btcli" }}
<a href="https://crates.io/crates/btcli" class="btn btn-outline external" target="_blank" rel="noopener">Crates.io</a>
{{ end }}
</div>
<!-- Features -->
<div class="sw-features">
{{ range .features }}
<div class="feature-card">
<h3>{{ .title }}</h3>
<p>{{ .desc }}</p>
</div>
{{ end }}
</div>
<!-- Install -->
{{ with .install }}
<div class="sw-section">
<h2>安装</h2>
<div class="sw-code">{{ . }}</div>
</div>
{{ end }}
<!-- Usage -->
{{ with .usage }}
<div class="sw-section">
<h2>使用</h2>
<div class="usage-list">
{{ range . }}
<div class="usage-item">
<code>{{ .cmd }}</code>
<span>{{ .desc }}</span>
</div>
{{ end }}
</div>
</div>
{{ end }}
<!-- License -->
{{ with .license }}
<div class="sw-section">
<h2>许可证</h2>
<p>{{ . }}</p>
</div>
{{ end }}
<!-- Drag ball for btcli -->
{{ if .has_drag_ball }}
<div class="drag-ball-area">
<canvas id="drag-ball" width="200" height="200"></canvas>
<p class="drag-hint">拖动小球试试 (¬‿¬)</p>
</div>
{{ end }}
</section>
{{ end }}
{{ end }}
{{ define "extra_scripts" }}
{{ $slug := .Params.project }}
{{ $matched := where hugo.Data.projects.projects "slug" $slug }}
{{ with index $matched 0 }}
{{ if .has_drag_ball }}
<script src="/js/drag-ball.js"></script>
{{ end }}
{{ end }}
{{ end }}
+14
View File
@@ -0,0 +1,14 @@
{{ define "body" }}
<section class="page-hero" style="--accent: #f44336">
<h1>{{ .Title }}</h1>
<p class="subtitle">{{ .Description }}</p>
</section>
<section class="page-content container">
<div class="xag-intro">
<img src="{{ .Site.Params.logo }}" alt="XAGuarder" class="xag-logo" width="120" height="120">
<h2>XAGuarder</h2>
<p>先占个位,XAGuarder 还要一段时间才能上线。当前已具备 IP、域名拦截能力。</p>
<a href="/xaguarder/warning/" class="btn btn-accent">查看拦截页面预览</a>
</div>
</section>
{{ end }}
+17
View File
@@ -0,0 +1,17 @@
{{ define "body" }}
<section class="warning-page" style="--accent: #f44336">
<div class="warning-content">
<img src="{{ .Site.Params.logo }}" alt="XAGuarder" class="warning-logo" width="120" height="120">
<h1>发现不良网站!</h1>
<p class="warning-text">XAGuarder 保护了您。</p>
<p class="warning-sub">如果这是正常的网站,请检查是否通过当地公安机关备案。</p>
<a href="/" class="btn btn-primary">返回主页</a>
</div>
</section>
{{ end }}
{{ define "extra_head" }}
<style>
.warning-page { --accent: #f44336; }
</style>
{{ end }}