
用于生成静态公共 ddev.com 网站的 Astro 源代码。
概览
DDEV的静态网站,使用Astro和Tailwind CSS构建,托管在Cloudflare Pages上。 布局遵循Astro的项目结构。本网站特定部分: - – 在本地开发过程中缓存的 GitHub API 响应,以减少 API 调用。- – 图片、标志和重定向,复制到 dist/。- – 博客文章和作者的 Markdown 格式,通过 src/content.config.ts 中的内容集合模式验证。- – .astro 和 .mdx 页面,其文件名会变成路由。- – Layout.astro,每个页面都使用,以及 MarkdownLayout.astro,用于 .mdx 页面。- – GitHub API 抓取、搜索索引,以及博客 Markdown 的备注和炒作插件。- – 精选赞助商,详见赞助商管理。 1. 运行 ddev start。它会安装依赖并启动开发服务器。2. 打开 .ddev.site:4321 https://。你编辑时开发服务器会自动重新加载。 提交前先运行 ddev prettier 和 ddev textlint。CI 也执行同样的检查。 1. 运行nvm,使用Node.js版本。
概述(AI 翻译)
ddev.com 的源代码
DDEV的静态网站,使用Astro和Tailwind CSS构建,托管在Cloudflare Pages上。
贡献者培训****Markdown格式 ·代理指导 ·赞助商DDEV
项目结构
布局遵循Astro的项目结构。本网站特定部分:
cache/– 在本地开发过程中缓存的GitHub API响应,以减少API调用。public/– 图像、标志和重定向,复制到dist/中。src/content/– 博客文章和作者的Markdown,通过src/content.config.ts中的内容集合模式验证。src/pages/–.astro和 [.mdx的页面,其文件名成为路由。src/layouts/–Layout.astro,每页使用,MarkdownLayout.astro,用于.mdx页面。src/lib/– GitHub API 获取、搜索索引,以及博客 Markdown 的备注和 rehype 插件。src/featured-sponsors.json– 主要赞助商,详见赞助商管理。
发展
DDEV设置
DDEV包含所有依赖。
- 运行
ddev start。它安装依赖并启动开发服务器。 - 打开’https://.ddev.
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Project Structure
The layout follows Astro’s project structure. The parts specific to this site:
cache/– GitHub API responses cached during local development, to reduce API calls.public/– images, logos, and redirects, copied as they are intodist/.src/content/– Markdown for the blog posts and authors, validated by the content collections schemas insrc/content.config.ts.src/pages/–.astroand.mdxpages whose filenames become routes.src/layouts/–Layout.astro, used by every page, andMarkdownLayout.astro, used by the.mdxpages.src/lib/– GitHub API fetching, the search index, and the remark and rehype plugins for blog Markdown.src/featured-sponsors.json– the featured sponsors, see Sponsor Management.
Development
DDEV Setup
DDEV includes all the dependencies.
- Run
ddev start. It installs dependencies and starts the dev server. - Open
https://.ddev.site:4321. The dev server reloads as you edit.
| Command | Action |
|---|---|
ddev npm run build |
Build the production site to dist/, served at https://.ddev.site |
ddev prettier [file] |
Fix formatting of the whole tree, or of the given files |
ddev textlint [file] |
Fix wording in src/content/**, or in the given files, then report what is left |
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add ddev/ddev.com