GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - eou/Mistery: Mi姐交易笔记:基于 Astro 与 Markdown 的静态教程网站

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

64 Commits
64 Commits

Folders and files

NameName
Last commit message
Last commit date
public
public
 
 
scripts
scripts
 
 
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
Mi姐.md
Mi姐.md
 
 
README.md
README.md
 
 
astro.config.ts
astro.config.ts
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
wrangler.jsonc
wrangler.jsonc
 
 

Repository files navigation

Mi姐交易笔记教程站

基于 Astro 与 Markdown 的静态教程网站。当前内容源是 src/content/lessons/ 下的独立 Markdown 教程文件;根目录的 Mi姐.md 保留为历史归档,也可以在需要批量导入时作为重新切分的源文件。

本地运行

npm install
npm run dev

默认开发地址为 http://localhost:4321。

常用命令

npm run dev            # 启动本地开发,不会重新切分内容
npm run build          # 生成静态网站到 dist/,不会重新切分内容
npm run preview        # 预览构建结果
npm run verify         # 浏览器端到端验证
npm run content:build  # 默认不切分,只提示维护方式
npm run content:split  # 从 Mi姐.md 重新切分并覆盖 lessons

也可以直接运行:

npm run content:build -- --split

站点配置

站点名、正式域名、导航、页脚文案、GitHub 源文件编辑链接等统一维护在 src/site.config.ts。

常见修改:

  • 改域名:更新 siteConfig.url
  • 改站点名:更新 siteConfig.name
  • 改导航:更新 siteConfig.nav
  • 改 GitHub 编辑入口:更新 siteConfig.github.repo、branch 或 contentPath

Google 收录与统计

网站已经生成 /sitemap.xml 和 /robots.txt,可以在 Google Search Console 里提交站点地图:

https://mi.yanbo.im/sitemap.xml

统计脚本统一通过 src/site.config.ts 配置,当前默认启用:

Google Analytics: G-5BHRM3XB5M
Cloudflare Web Analytics: cf0d6bd9432447b791fc5cd3ff855bc1

部署环境里也可以设置环境变量覆盖:

GOOGLE_ANALYTICS_ID=G-XXXXXXXXXX
CLOUDFLARE_WEB_ANALYTICS_TOKEN=你的CloudflareToken

对应配置在 src/site.config.ts:

google: {
  analyticsId: env.GOOGLE_ANALYTICS_ID ?? 'G-5BHRM3XB5M',
  allowedHosts: ['mi.yanbo.im'],
},
cloudflare: {
  token: env.CLOUDFLARE_WEB_ANALYTICS_TOKEN ?? 'cf0d6bd9432447b791fc5cd3ff855bc1',
  allowedHosts: ['mi.yanbo.im'],
},

把 analyticsId 或 token 配成空字符串时,对应统计脚本不会输出。

内容更新

日常维护请直接编辑 src/content/lessons/ 下的小文件。每篇教程需要保留 frontmatter:

---
title: "教程标题"
description: "教程摘要"
slug: "lesson-semantic-slug"
chapter: 1
order: 1
---

新增教程时,在对应章节目录中新建文件,例如 src/content/lessons/chapter-6/140-lesson-semantic-slug.md,并填写完整 frontmatter。网站会根据 chapter + order 生成全站顺序、上一篇/下一篇和搜索索引,章节标题统一从站点配置读取。

重新切分

只有在你想从长文重新导入内容时,才运行 npm run content:split。默认只会在 .tmp/content-split/ 生成预览,不会修改现有教程。预览确认无误后,再运行 npm run content:split -- --force;它只替换 Mi姐.md 中包含的章节,未出现在源文件中的章节会保留。

切分生成的文件遵循当前结构:序号-英文-slug.md,frontmatter 会包含对应的 slug,order 使用章节内序号。

长文切分格式仍然是:一级章节标题使用 # 第X章:标题,每篇教程使用 ## 【教程标题】。

About

Mi姐交易笔记:基于 Astro 与 Markdown 的静态教程网站

mi.yanbo.im

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.