发布数据实时获取:版本、日期、文件大小与下载链接来自 GitHub Releases API,并以每小时 ISR 缓存
anvil-website — Next.js 企业官网模板
作者 kudzaiprichard
Anvil 的营销与下载站点,基于 Next.js App Router 构建,展示产品定位并引导访客下载 macOS、Windows、Linux 版本。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 2
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
平台感知下载:客户端识别访客操作系统,优先展示匹配的构建版本,同时保留完整产物清单
自包含设计:字体通过 next/font 自托管,图片为本地或生成路由,运行时无第三方服务调用
安全响应头:在 next.config.ts 中配置严格 CSP、HSTS、X-Frame-Options 与受限 Permissions-Policy
无障碍与响应式:键盘焦点状态、prefers-reduced-motion 回退,320px 至大屏无横向溢出
SEO 单一来源:元数据、OG、Twitter 卡片、manifest、robots、sitemap 与 JSON-LD 均读取 lib/site.ts
模板详细介绍
这是 Anvil 项目的官方网站,用于介绍这款免费、离线、面向经典 LeetCode 与 NeetCode 题目的练习工具,并引导访客下载对应平台的安装包。站点为单页结构,内容涵盖产品介绍、贡献者邀请以及最新版本二进制文件的下载入口。
站点在构建时通过 GitHub Releases API 获取最新版本信息,包括版本号、日期、文件大小与下载链接,并以每小时一次的 ISR 缓存,因此发布新版本后无需改动代码即可更新页面。访客的操作系统会在客户端被识别,匹配的构建版本会被优先展示,同时所有产物仍会列在清单中。字体通过 next/font 自托管,图片为本地资源或生成路由,并在 next.config.ts 中配置了严格的 Content-Security-Policy 以及 HSTS、X-Frame-Options 和受限的 Permissions-Policy。页面支持键盘焦点状态、prefers-reduced-motion 回退,并验证了从 320px 手机到大型显示器均无横向溢出。元数据、Open Graph、Twitter 卡片、web manifest、robots、sitemap 与 JSON-LD 均从 lib/site.ts 这一单一来源生成。
配置全部可选,无 .env 文件也能构建运行,会回退到 Anvil 的规范 URL。可覆盖的变量包括 NEXT_PUBLIC_SITE_URL、NEXT_PUBLIC_ANVIL_REPO 与 NEXT_PUBLIC_RELEASES_REPO,均为公开 URL,不涉及密钥。若 GitHub API 不可达(离线构建或限流),会使用 lib/releases.ts 中固定的 FALLBACK 版本。当发布产物的命名规则变化时,需要同时更新 ASSET_RULES 与回退数据。
适合你的项目吗?
适用场景
- 为开源桌面工具搭建产品介绍与多平台下载页面
- 需要从 GitHub Releases 自动同步版本信息、避免手动更新下载链接的站点
- 希望以严格 CSP 和自托管资源减少运行时外部依赖的营销页
- 需要同时覆盖桌面与移动端、并满足键盘操作与减少动效偏好的展示页
适合人群
- 为开源项目构建营销与下载入口的开发者
- 偏好 Next.js App Router 与静态预渲染的团队
- 需要按访客操作系统引导下载的跨平台工具维护者
- 关注内容安全策略与无障碍细节的站点作者
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
需要 Node.js 20.9+ 与 npm,仓库包含 package-lock.json,建议使用 npm ci 进行可复现安装
- 2
克隆后执行 git config core.hooksPath .githooks 以启用提交信息钩子
- 3
配置均为可选,可复制 .env.example 为 .env 覆盖 NEXT_PUBLIC_SITE_URL、NEXT_PUBLIC_ANVIL_REPO 与 NEXT_PUBLIC_RELEASES_REPO
- 4
在 Vercel 上若未设置 NEXT_PUBLIC_SITE_URL,会回退到注入的生产域名
- 5
发布产物命名变化时需同步更新 lib/releases.ts 中的 ASSET_RULES 与 FALLBACK
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
- 站点在构建或重新验证时会在服务端调用 GitHub Releases API 获取最新版本信息;若该外部接口不可达(离线构建或限流),则回退到固定的 FALLBACK 版本数据。
- 版本号、日期、文件大小与下载链接依赖 GitHub Releases API 实时获取,并以每小时一次的 ISR 缓存;发布新版本后需等待缓存刷新,且下载清单依赖该外部服务可用。
- 当发布产物的命名规则发生变化时,必须同步更新 lib/releases.ts 中的 ASSET_RULES 与回退数据,否则平台与下载链接的映射会失效。
- Anvil 名称与图标归 Anvil 项目所有,复用该模板时需注意品牌标识的使用限制,不能随意沿用其名称与图标。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
the only network call happens at build/revalidation time, server-side, to resolve the latest release.
README 原文
Version, date, file sizes, and download URLs are fetched from the GitHub Releases API and cached with hourly ISR
README 原文
When release asset naming changes, update `ASSET_RULES` **and** the fallback in [`lib/releases.ts`](./lib/releases.ts).
README 原文
https://github.com/kudzaiprichard/anvil-website/blob/main/LICENSEhttps://github.com/kudzaiprichard/anvil-website/blob/main/README.mdThe Anvil name and icon belong to the [Anvil project](https://github.com/kudzaiprichard/anvil).
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-13。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 80 / 100
- 技术栈
- Next.js · React
- 网站类型
- 企业官网
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2026-07-20
- 截图检查日期
- 2026-10-13
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
审核声明: [email protected] · 2026-10-13
查看当时使用的来源资料
SHA-256: 623d7beee7003894e7349a59ee8d166102ab089b12b77a707b470e5b419d1806
2026-10-13T08:36:37.671Z
来源文件 / 仓库<div align="center">
<img src="./public/anvil-icon-64.png" alt="Anvil" width="72" />
# Anvil — Website
The marketing & download site for **[Anvil](https://github.com/kudzaiprichard/anvil)** — the free,
offline, honest way to master the classic LeetCode & NeetCode questions.
**Next.js 16** (App Router) · React 19 · TypeScript · zero runtime dependencies beyond React.
</div>
---
## Overview
A single-page site that introduces Anvil, makes the case for it, invites contributors, and routes
visitors to the latest release binaries for macOS, Windows, and Linux. It is statically prerendered,
ships no client-side data fetching, and calls no third-party services at runtime — the only network
call happens at build/revalidation time, server-side, to resolve the latest release.
### Key characteristics
- **Release data is live, not hardcoded.** Version, date, file sizes, and download URLs are fetched
from the GitHub Releases API and cached with hourly ISR, so publishing a release updates the site
with no code change ([`lib/releases.ts`](./lib/releases.ts)).
- **Platform-aware downloads.** The visitor's OS is detected client-side and the matching build is
surfaced first, with every artifact still listed in the manifest.
- **Self-contained by design.** Fonts are self-hosted via `next/font`; images are local or generated
routes; a strict Content-Security-Policy (`default-src 'self'`) is enforced in
[`next.config.ts`](./next.config.ts) alongside HSTS, `X-Frame-Options`, and a locked-down
`Permissions-Policy`.
- **Accessible & responsive.** Keyboard focus states, `prefers-reduced-motion` fallbacks on every
animation, and a layout verified with no horizontal overflow from 320px phones to large monitors.
- **SEO surfaces derive from one source.** Metadata, Open Graph, Twitter cards, the web manifest,
`robots`, `sitemap`, and JSON-LD all read from [`lib/site.ts`](./lib/site.ts).
## Prerequisites
- **Node.js 20.9+** (CI runs on Node 20; developed on Node 24).
- **npm** (the repo ships a `package-lock.json`; use `npm ci` for reproducible installs).
## Getting started
```bash
npm install
npm run dev # http://localhost:3000
```
Enable the commit-message hook once after cloning (see [Contributing](#contributing)):
```bash
git config core.hooksPath .githooks
```
## Scripts
| Script | Purpose |
| ------------------- | ------------------------------------------------ |
| `npm run dev` | Start the dev server with HMR. |
| `npm run typecheck` | `tsc --noEmit` — strict type checking, no build. |
| `npm run build` | Production build (static prerender). |
| `npm start` | Serve the production build. |
## Configuration
All configuration is optional — the site builds and runs with no `.env` file, falling back to the
canonical Anvil URLs. Copy [`.env.example`](./.env.example) to `.env` to override. Every value is a
public URL; there are no secrets.
| Variable | Purpose |
| --------------------------- | ------------------------------------------------------------------------------ |
| `NEXT_PUBLIC_SITE_URL` | Canonical production URL for absolute SEO links (canonical, OG, sitemap, JSON-LD). |
| `NEXT_PUBLIC_ANVIL_REPO` | `owner/name` of the source repo — drives every GitHub link. |
| `NEXT_PUBLIC_RELEASES_REPO` | `owner/name` of the releases repo — drives the download manifest. |
On Vercel, `NEXT_PUBLIC_SITE_URL` falls back to the injected production domain if unset. See
[`lib/site.ts`](./lib/site.ts) for the exact resolution order.
## Project structure
```
app/ App Router: root layout, page, metadata & generated routes
(opengraph-image, apple-icon, manifest, robots, sitemap),
and the global + component stylesheets.
components/ UI and the animated canvas backgrounds (FieldCanvas, GraphField,
TopoField, LatticeField, ForgeField, StarVoid) plus the section
components that compose the page.
lib/ releases.ts — live release data + platform/asset mapping.
site.ts — single source of truth for site identity & SEO.
anvil-mark.tsx — the brand mark as an inline SVG.
public/ Static icons.
```
### How release data flows
`getLatestRelease()` fetches `releases/latest` from the GitHub API for the configured releases repo,
revalidated hourly (ISR). `ASSET_RULES` maps each published asset's filename onto a platform slot
(macOS / Windows / Linux) with a human label. If the API is unreachable (offline build, rate limit),
a pinned `FALLBACK` release is served instead. When release asset naming changes, update `ASSET_RULES`
**and** the fallback in [`lib/releases.ts`](./lib/releases.ts).
## Contributing
Every change lands via pull request into a protected `main`, mirroring the conventions of the main
Anvil repo:
- Short-lived `feat/…`, `fix/…`, `docs/…`, `chore/…` branches off `main`.
- Conventional commits — `type(scope): summary` followed by one `- path: what changed` bullet per
file, enforced by the `commit-msg` hook in [`.githooks`](./.githooks).
- CI (`Lint & build (web)`) runs typecheck + build and must pass, and a code owner must approve,
before merge.
## License
[MIT](./LICENSE) © Kudzai P Matizirofa. The Anvil name and icon belong to the
[Anvil project](https://github.com/kudzaiprichard/anvil).
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

SaaS-Boilerplate
🚀🎉📚 SaaS Boilerplate built with Next.js + Tailwind CSS + Shadcn UI + TypeScript. ⚡️ Full-stack React applic…
Next.js · SaaS

Next-JS-Landing-Page-Starter-Template
🚀 Free NextJS Landing Page Template written in Tailwind CSS 3 and TypeScript ⚡️ Made with developer experienc…
Next.js · 企业官网

next-saas-starter
⚡️ Free Next.js responsive landing page template for SaaS products made using JAMStack architecture.
Next.js · SaaS

startup-nextjs
Startup is free Next.js template for SaaS startups comes with all the essential pages, components, and section…
Next.js · SaaS

shadcn-landing-page
New design 🎉 Nextjs + Shadcn + TypeScript + Tailwind. Landing page template ease-to-use
Next.js · 企业官网

shadcn-dashboard-landing-template
Accelerate your development with a sleek, open-source admin dashboard and landing page built on Vite-React, Ne…
Next.js · 后台
