write-concept
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill: Write JavaScript Concept Documentation
技能:编写JavaScript概念文档
Use this skill when writing or improving concept documentation pages for the 33 JavaScript Concepts project.
当你为33 JavaScript Concepts项目编写或优化概念文档页面时,使用本技能。
When to Use
使用场景
- Creating a new concept page in
/docs/concepts/ - Rewriting or significantly improving an existing concept page
- Reviewing an existing concept page for quality and completeness
- Adding explanatory content to a concept
- 在目录下创建新的概念页面
/docs/concepts/ - 重写或大幅优化现有概念页面
- 审核现有概念页面的质量与完整性
- 为概念页面添加解释性内容
Target Audience
目标受众
Remember: the reader might be someone who has never coded before or is just learning JavaScript. Write with empathy for beginners while still providing depth for intermediate developers. Make complex topics feel approachable and never assume prior knowledge without linking to prerequisites.
请记住:读者可能是从未写过代码的新手,或是刚接触JavaScript的学习者。写作时要共情初学者,同时也要为中级开发者提供足够深度的内容。让复杂的主题变得易于理解,切勿在未链接前置知识的前提下假设读者已有相关认知。
Writing Guidelines
写作指南
Voice and Tone
语气与语调
- Conversational but authoritative: Write like you're explaining to a smart friend
- Encouraging: Make complex topics feel approachable
- Practical: Focus on real-world applications and use cases
- Concise: Respect the reader's time; avoid unnecessary verbosity
- Question-driven: Open sections with questions the reader might have
- 口语化但专业:就像给聪明的朋友讲解一样写作
- 鼓励性:让复杂主题显得易于上手
- 实用性:聚焦实际应用场景
- 简洁性:尊重读者时间,避免冗余内容
- 问题驱动:用读者可能会问的问题开启章节
Avoiding AI-Generated Language
避免AI生成式语言
Your writing must sound human, not AI-generated. Here are specific patterns to avoid:
你的写作必须听起来像人类创作,而非AI生成。以下是需要避免的特定模式:
Words and Phrases to Avoid
需避免的词汇与短语
| ❌ Avoid | ✓ Use Instead |
|---|---|
| "Master [concept]" | "Learn [concept]" |
| "dramatically easier/better" | "much easier" or "cleaner" |
| "one fundamental thing" | "one simple thing" |
| "one of the most important concepts" | "This is a big one" |
| "essential points" | "key things to remember" |
| "understanding X deeply improves" | "knowing X well makes Y easier" |
| "To truly understand" | "Let's look at" or "Here's how" |
| "This is crucial" | "This trips people up" |
| "It's worth noting that" | Just state the thing directly |
| "It's important to remember" | "Don't forget:" or "Remember:" |
| "In order to" | "To" |
| "Due to the fact that" | "Because" |
| "At the end of the day" | Remove entirely |
| "When it comes to" | Remove or rephrase |
| "In this section, we will" | Just start explaining |
| "As mentioned earlier" | Remove or link to the section |
| ❌ 需避免 | ✓ 替代表达 |
|---|---|
| "Master [concept]" | "Learn [concept]" |
| "dramatically easier/better" | "much easier" 或 "cleaner" |
| "one fundamental thing" | "one simple thing" |
| "one of the most important concepts" | "This is a big one" |
| "essential points" | "key things to remember" |
| "understanding X deeply improves" | "knowing X well makes Y easier" |
| "To truly understand" | "Let's look at" 或 "Here's how" |
| "This is crucial" | "This trips people up" |
| "It's worth noting that" | 直接陈述内容即可 |
| "It's important to remember" | "Don't forget:" 或 "Remember:" |
| "In order to" | "To" |
| "Due to the fact that" | "Because" |
| "At the end of the day" | 直接删除 |
| "When it comes to" | 删除或改写 |
| "In this section, we will" | 直接开始讲解 |
| "As mentioned earlier" | 删除或链接到对应章节 |
Repetitive Emphasis Patterns
重复强调模式
Don't use the same lead-in pattern repeatedly. Vary your emphasis:
| Instead of repeating... | Vary with... |
|---|---|
| "Key insight:" | "Don't forget:", "The pattern:", "Here's the thing:" |
| "Best practice:" | "Pro tip:", "Quick check:", "A good habit:" |
| "Important:" | "Watch out:", "Heads up:", "Note:" |
| "Remember:" | "Keep in mind:", "The rule:", "Think of it this way:" |
不要重复使用相同的引导模式。多样化你的强调方式:
| 避免重复... | 替换为... |
|---|---|
| "Key insight:" | "Don't forget:", "The pattern:", "Here's the thing:" |
| "Best practice:" | "Pro tip:", "Quick check:", "A good habit:" |
| "Important:" | "Watch out:", "Heads up:", "Note:" |
| "Remember:" | "Keep in mind:", "The rule:", "Think of it this way:" |
Em Dash (—) Overuse
过度使用破折号(—)
AI-generated text overuses em dashes. Limit their use and prefer periods, commas, or colons:
| ❌ Em Dash Overuse | ✓ Better Alternative |
|---|---|
| "async/await — syntactic sugar that..." | "async/await. It's syntactic sugar that..." |
| "understand Promises — async/await is built..." | "understand Promises. async/await is built..." |
| "doesn't throw an error — you just get..." | "doesn't throw an error. You just get..." |
| "outside of async functions — but only in..." | "outside of async functions, but only in..." |
| "Fails fast — if any Promise rejects..." | "Fails fast. If any Promise rejects..." |
| "achieve the same thing — the choice..." | "achieve the same thing. The choice..." |
When em dashes ARE acceptable:
- In Key Takeaways section (consistent formatting for the numbered list)
- In MDN card titles (e.g., "async function — MDN")
- In interview answer step-by-step explanations (structured formatting)
- Sparingly when a true parenthetical aside reads naturally
Rule of thumb: If you have more than 10-15 em dashes in a 1500-word document outside of structured sections, you're overusing them. After writing, search for "—" and evaluate each one.
AI生成的文本会过度使用破折号。限制其使用,优先使用句号、逗号或冒号:
| ❌ 过度使用破折号 | ✓ 更好的替代方案 |
|---|---|
| "async/await — syntactic sugar that..." | "async/await. It's syntactic sugar that..." |
| "understand Promises — async/await is built..." | "understand Promises. async/await is built..." |
| "doesn't throw an error — you just get..." | "doesn't throw an error. You just get..." |
| "outside of async functions — but only in..." | "outside of async functions, but only in..." |
| "Fails fast — if any Promise rejects..." | "Fails fast. If any Promise rejects..." |
| "achieve the same thing — the choice..." | "achieve the same thing. The choice..." |
破折号的合理使用场景:
- 关键要点章节(编号列表的统一格式)
- MDN卡片标题(例如:"async function — MDN")
- 面试答案的分步解释(结构化格式)
- 偶尔用于自然的插入语补充
经验法则: 在1500字的文档中,若结构化章节外的破折号使用超过10-15个,即为过度使用。写完后搜索"—"并逐一评估是否必要。
Superlatives and Filler Words
最高级与填充词
Avoid vague superlatives that add no information:
| ❌ Avoid | ✓ Use Instead |
|---|---|
| "dramatically" | "much" or remove entirely |
| "fundamentally" | "simply" or be specific about what's fundamental |
| "incredibly" | remove or be specific |
| "extremely" | remove or be specific |
| "absolutely" | remove |
| "basically" | remove (if you need it, you're not explaining clearly) |
| "essentially" | remove or just explain directly |
| "very" | remove or use a stronger word |
| "really" | remove |
| "actually" | remove (unless correcting a misconception) |
| "In fact" | remove (just state the fact) |
| "Interestingly" | remove (let the reader decide if it's interesting) |
避免使用无实际信息的模糊最高级:
| ❌ 需避免 | ✓ 替代表达 |
|---|---|
| "dramatically" | "much" 或直接删除 |
| "fundamentally" | "simply" 或具体说明哪些是基础内容 |
| "incredibly" | 删除或具体说明 |
| "extremely" | 删除或具体说明 |
| "absolutely" | 删除 |
| "basically" | 删除(如果需要这个词,说明你的解释不够清晰) |
| "essentially" | 删除或直接解释 |
| "very" | 删除或使用更有力的词汇 |
| "really" | 删除 |
| "actually" | 删除(除非用于纠正误解) |
| "In fact" | 删除(直接陈述事实即可) |
| "Interestingly" | 删除(让读者自行判断是否有趣) |
Stiff/Formal Phrases
生硬/正式短语
Replace formal academic-style phrases with conversational alternatives:
| ❌ Stiff | ✓ Conversational |
|---|---|
| "It should be noted that" | "Note that" or just state it |
| "One might wonder" | "You might wonder" |
| "This enables developers to" | "This lets you" |
| "The aforementioned" | "this" or name it again |
| "Subsequently" | "Then" or "Next" |
| "Utilize" | "Use" |
| "Commence" | "Start" |
| "Prior to" | "Before" |
| "In the event that" | "If" |
| "A considerable amount of" | "A lot of" or "Many" |
用口语化表达替代正式的学术风格短语:
| ❌ 生硬表达 | ✓ 口语化表达 |
|---|---|
| "It should be noted that" | "Note that" 或直接陈述内容 |
| "One might wonder" | "You might wonder" |
| "This enables developers to" | "This lets you" |
| "The aforementioned" | "this" 或再次提及名称 |
| "Subsequently" | "Then" 或 "Next" |
| "Utilize" | "Use" |
| "Commence" | "Start" |
| "Prior to" | "Before" |
| "In the event that" | "If" |
| "A considerable amount of" | "A lot of" 或 "Many" |
Playful Touches (Use Sparingly)
趣味点缀(适度使用)
Add occasional human touches to make the content feel less robotic, but don't overdo it:
javascript
// ✓ Good: One playful comment per section
// Callback hell - nested so deep you need a flashlight
// ✓ Good: Conversational aside
// forEach and async don't play well together — it just fires and forgets:
// ✓ Good: Relatable frustration
// Finally, error handling that doesn't make you want to flip a table.
// ❌ Bad: Trying too hard
// Callback hell - it's like a Russian nesting doll had a baby with a spaghetti monster! 🍝
// ❌ Bad: Forced humor
// Let's dive into the AMAZING world of Promises! 🎉🚀Guidelines:
- One or two playful touches per major section is enough
- Humor should arise naturally from the content
- Avoid emojis in body text (they're fine in comments occasionally)
- Don't explain your jokes
- If a playful line doesn't work, just be direct instead
偶尔添加人性化的内容,让内容不那么机械,但不要过度:
javascript
// ✓ 合理:每个章节添加一个趣味注释
// 回调地狱 - 嵌套太深,你需要手电筒才能找到出口
// ✓ 合理:口语化补充
// forEach 和 async 相处不来 — 它只会一触发就不管了:
// ✓ 合理:引起共鸣的吐槽
// 终于有了不会让你想掀桌子的错误处理方式。
// ❌ 过度:用力过猛
// 回调地狱 - 就像俄罗斯套娃和意大利面怪物生的孩子!🍝
// ❌ 过度:强行搞笑
// 让我们一起踏入Promises的神奇世界吧!🎉🚀指南:
- 每个主要章节添加1-2个趣味内容即可
- 幽默应自然源于内容本身
- 正文避免使用表情符号(偶尔在注释中使用是可以的)
- 不要解释你的笑话
- 如果趣味内容不合适,直接采用直白的表达
Page Structure (Follow This Exactly)
页面结构(严格遵循)
Every concept page MUST follow this structure in this exact order:
mdx
---
title: "Concept Name: [Hook] in JavaScript"
sidebarTitle: "Concept Name: [Hook]"
description: "SEO-friendly description in 150-160 characters starting with action word"
---
[Opening hook - Start with engaging questions that make the reader curious]
[Example: "How does JavaScript get data from a server? How do you load user profiles, submit forms, or fetch the latest posts from an API?"]
[Immediately show a simple code example demonstrating the concept]
```javascript
// This is how you [do the thing] in JavaScript
const example = doSomething()
console.log(example) // Expected output[Brief explanation connecting to what they'll learn, with inline MDN links for key terms]
<Info>
**What you'll learn in this guide:**
- Key learning outcome 1
- Key learning outcome 2
- Key learning outcome 3
- Key learning outcome 4 (aim for 5-7 items)
</Info>
<Warning>
[Optional: Prerequisites or important notices - place AFTER Info box]
**Prerequisite:** This guide assumes you understand [Related Concept](/concepts/related-concept). If you're not comfortable with that yet, read that guide first!
</Warning>
每个概念页面必须严格按照以下顺序排列结构:
mdx
---
title: "概念名称: [Hook] in JavaScript"
sidebarTitle: "概念名称: [Hook]"
description: "150-160字符的SEO友好描述,以动作词开头"
---
[开篇钩子 - 用吸引人的问题勾起读者好奇心]
[示例:"JavaScript如何从服务器获取数据?如何加载用户资料、提交表单或从API获取最新帖子?"]
[立即展示一个演示该概念的简单代码示例]
```javascript
// 这是你在JavaScript中[实现功能]的方式
const example = doSomething()
console.log(example) // 预期输出[简短解释,关联读者将学到的内容,并为关键术语添加**内嵌MDN链接**]
<Info>
**你将在本指南中学到:**
- 核心学习成果1
- 核心学习成果2
- 核心学习成果3
- 核心学习成果4(目标5-7项)
</Info>
<Warning>
[可选:前置知识或重要提示 - 放在Info框之后]
**前置知识:** 本指南假设你已理解[相关概念](/concepts/related-concept)。如果你还不熟悉,请先阅读该指南!
</Warning>
[First Major Section - e.g., "What is X?"]
[第一个主要章节 - 例如:"什么是X?"]
[Core explanation with inline MDN links for any new terms/APIs introduced]
[Optional: CardGroup with MDN reference links for this section]
[核心解释,为所有新引入的术语/API添加内嵌MDN链接]
[可选:为本章节添加包含MDN参考链接的CardGroup]
[Analogy Section - e.g., "The Restaurant Analogy"]
[类比章节 - 例如:"餐厅类比"]
[Relatable real-world analogy that makes the concept click]
[ASCII art diagram visualizing the concept]
┌─────────────────────────────────────────────────────────────────────────┐
│ DIAGRAM TITLE │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ [Visual representation of the concept] │
│ │
└─────────────────────────────────────────────────────────────────────────┘[贴近现实的类比,帮助读者理解概念]
[用于可视化概念的ASCII艺术图]
┌─────────────────────────────────────────────────────────────────────────┐
│ 图表标题 │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ [概念的可视化表示] │
│ │
└─────────────────────────────────────────────────────────────────────────┘[Core Concepts Section]
[核心概念章节]
[Deep dive with code examples, tables, and Mintlify components]
<Steps>
<Step title="Step 1">
Explanation of the first step
</Step>
<Step title="Step 2">
Explanation of the second step
</Step>
</Steps>
<AccordionGroup>
<Accordion title="Subtopic 1">
Detailed explanation with code examples
</Accordion>
<Accordion title="Subtopic 2">
Detailed explanation with code examples
</Accordion>
</AccordionGroup>
<Tip>
**Quick Rule of Thumb:** [Memorable summary or mnemonic]
</Tip>
[深入讲解,包含代码示例、表格和Mintlify组件]
<Steps>
<Step title="步骤1">
第一步的解释
</Step>
<Step title="步骤2">
第二步的解释
</Step>
</Steps>
<AccordionGroup>
<Accordion title="子主题1">
带代码示例的详细解释
</Accordion>
<Accordion title="子主题2">
带代码示例的详细解释
</Accordion>
</AccordionGroup>
<Tip>
**快速经验法则:** [易记的总结或助记符]
</Tip>
[The API/Implementation Section]
[API/实现章节]
[How to actually use the concept in code]
[如何在代码中实际使用该概念]
Basic Usage
基础用法
javascript
// Basic example with step-by-step comments
// Step 1: Do this
const step1 = something()
// Step 2: Then this
const step2 = somethingElse(step1)
// Step 3: Finally
console.log(step2) // Expected outputjavascript
// 带分步注释的基础示例
// 步骤1:执行此操作
const step1 = something()
// 步骤2:然后执行此操作
const step2 = somethingElse(step1)
// 步骤3:最后
console.log(step2) // 预期输出[Advanced Pattern]
[高级模式]
javascript
// More complex real-world examplejavascript
// 更复杂的实际场景示例[Common Mistakes Section - e.g., "The #1 Fetch Mistake"]
[常见错误章节 - 例如:"最常见的Fetch错误"]
[Highlight the most common mistake developers make]
┌─────────────────────────────────────────────────────────────────────────┐
│ VISUAL COMPARISON │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ WRONG WAY RIGHT WAY │
│ ───────── ───────── │
│ • Problem 1 • Solution 1 │
│ • Problem 2 • Solution 2 │
│ │
└─────────────────────────────────────────────────────────────────────────┘javascript
// ❌ WRONG - Explanation of why this is wrong
const bad = wrongApproach()
// ✓ CORRECT - Explanation of the right way
const good = correctApproach()[突出开发者最常犯的错误]
┌─────────────────────────────────────────────────────────────────────────┐
│ 可视化对比 │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ 错误方式 正确方式 │
│ ───────── ───────── │
│ • 问题1 • 解决方案1 │
│ • 问题2 • 解决方案2 │
│ │
└─────────────────────────────────────────────────────────────────────────┘javascript
// ❌ 错误 - 解释错误原因
const bad = wrongApproach()
// ✓ 正确 - 解释正确方式
const good = correctApproach()[Advanced Patterns Section]
[高级模式章节]
[Real-world patterns and best practices]
[实际场景中的模式与最佳实践]
Pattern Name
模式名称
javascript
// Reusable pattern with practical application
async function realWorldExample() {
// Implementation
}
// Usage
const result = await realWorldExample()javascript
// 可复用的实际场景模式
async function realWorldExample() {
// 实现代码
}
// 使用示例
const result = await realWorldExample()Key Takeaways
关键要点
<Info>
**The key things to remember:**
-
First key point — Brief explanation
-
Second key point — Brief explanation
-
Third key point — Brief explanation
-
Fourth key point — Brief explanation
-
Fifth key point — Brief explanation
[Aim for 8-10 key takeaways that summarize everything]
</Info>
<Info>
**需要记住的核心内容:**
-
第一个关键点 — 简短解释
-
第二个关键点 — 简短解释
-
第三个关键点 — 简短解释
-
第四个关键点 — 简短解释
-
第五个关键点 — 简短解释
[目标总结8-10个要点]
</Info>
Test Your Knowledge
测试你的知识
<AccordionGroup>
<Accordion title="Question 1: [Specific question about the concept]">
**Answer:**
</Accordion>
<Accordion title="Question 2: [Another question]">
**Answer:**
</Accordion>
[Clear explanation]
```javascript
// Code example demonstrating the answer
```[Clear explanation with code if needed][Aim for 5-6 questions covering the main topics]
</AccordionGroup>
<AccordionGroup>
<Accordion title="问题1: [关于概念的具体问题]">
**答案:**
</Accordion>
<Accordion title="问题2: [另一个问题]">
**答案:**
</Accordion>
[清晰解释]
```javascript
// 演示答案的代码示例
```[清晰解释,必要时附带代码][目标设置5-6个覆盖主要主题的问题]
</AccordionGroup>
Related Concepts
相关概念
<CardGroup cols={2}>
<Card title="Related Concept 1" icon="icon-name" href="/concepts/slug">
How it connects to this concept
</Card>
<Card title="Related Concept 2" icon="icon-name" href="/concepts/slug">
How it connects to this concept
</Card>
</CardGroup>
<CardGroup cols={2}>
<Card title="相关概念1" icon="icon-name" href="/concepts/slug">
与本概念的关联
</Card>
<Card title="相关概念2" icon="icon-name" href="/concepts/slug">
与本概念的关联
</Card>
</CardGroup>
Reference
参考资料
<CardGroup cols={2}>
<Card title="Main Topic — MDN" icon="book" href="https://developer.mozilla.org/...">
Official MDN documentation for the main concept
</Card>
<Card title="Related API — MDN" icon="book" href="https://developer.mozilla.org/...">
Additional MDN reference
</Card>
</CardGroup>
<CardGroup cols={2}>
<Card title="主要主题 — MDN" icon="book" href="https://developer.mozilla.org/...">
核心概念的官方MDN文档
</Card>
<Card title="相关API — MDN" icon="book" href="https://developer.mozilla.org/...">
额外的MDN参考资料
</Card>
</CardGroup>
Articles
文章
<CardGroup cols={2}>
<Card title="Article Title" icon="newspaper" href="https://...">
Brief description of what the reader will learn from this article.
</Card>
[Aim for 4-6 high-quality articles]
</CardGroup>
<CardGroup cols={2}>
<Card title="文章标题" icon="newspaper" href="https://...">
读者将从本文中学到的内容简介。
</Card>
[目标选取4-6篇高质量文章]
</CardGroup>
Videos
视频
<CardGroup cols={2}>
<Card title="Video Title" icon="video" href="https://...">
Brief description of what the video covers.
</Card>
[Aim for 3-4 quality videos]
</CardGroup>
```
<CardGroup cols={2}>
<Card title="视频标题" icon="video" href="https://...">
视频内容简介。
</Card>
[目标选取3-4个高质量视频]
</CardGroup>
```
SEO Guidelines
SEO指南
SEO (Search Engine Optimization) is critical for this project. Each concept page should rank for the various ways developers search for that concept. Our goal is to appear in search results for queries like:
- "what is [concept] in JavaScript"
- "how does [concept] work in JavaScript"
- "[concept] JavaScript explained"
- "[concept] JavaScript tutorial"
- "JavaScript [concept] example"
Every writing decision — from title to structure to word choice — should consider search intent.
SEO(搜索引擎优化)对本项目至关重要。每个概念页面都应针对开发者搜索该概念的各种方式排名。我们的目标是在以下类似查询的搜索结果中出现:
- "what is [concept] in JavaScript"
- "how does [concept] work in JavaScript"
- "[concept] JavaScript explained"
- "[concept] JavaScript tutorial"
- "JavaScript [concept] example"
从标题到结构再到措辞,每一个写作决策都应考虑搜索意图。
Target Keywords for Each Concept
每个概念的目标关键词
Each concept page targets a keyword cluster — the family of related search queries. Before writing, identify these for your concept:
| Keyword Type | Pattern | Example (DOM) |
|---|---|---|
| Primary | [concept] + JavaScript | "DOM JavaScript", "JavaScript DOM" |
| What is | what is [concept] in JavaScript | "what is the DOM in JavaScript" |
| How does | how does [concept] work | "how does the DOM work in JavaScript" |
| How to | how to [action] with [concept] | "how to manipulate the DOM" |
| Tutorial | [concept] tutorial/guide/explained | "DOM tutorial JavaScript" |
| Comparison | [concept] vs [related] | "DOM vs virtual DOM" |
More Keyword Cluster Examples:
<AccordionGroup>
<Accordion title="Closures Keyword Cluster">
| Type | Keywords |
|------|----------|
| Primary | "JavaScript closures", "closures in JavaScript" |
| What is | "what is a closure in JavaScript", "what are closures" |
| How does | "how do closures work in JavaScript", "how closures work" |
| Why use | "why use closures JavaScript", "closure use cases" |
| Example | "JavaScript closure example", "closure examples" |
| Interview | "closure interview questions JavaScript" |
</Accordion>
<Accordion title="Promises Keyword Cluster">
| Type | Keywords |
|------|----------|
| Primary | "JavaScript Promises", "Promises in JavaScript" |
| What is | "what is a Promise in JavaScript", "what are Promises" |
| How does | "how do Promises work", "how Promises work JavaScript" |
| How to | "how to use Promises", "how to chain Promises" |
| Comparison | "Promises vs callbacks", "Promises vs async await" |
| Error | "Promise error handling", "Promise catch" |
</Accordion>
<Accordion title="Event Loop Keyword Cluster">
| Type | Keywords |
|------|----------|
| Primary | "JavaScript event loop", "event loop JavaScript" |
| What is | "what is the event loop in JavaScript" |
| How does | "how does the event loop work", "how event loop works" |
| Visual | "event loop explained", "event loop visualization" |
| Related | "call stack and event loop", "task queue JavaScript" |
</Accordion>
<Accordion title="Call Stack Keyword Cluster">
| Type | Keywords |
|------|----------|
| Primary | "JavaScript call stack", "call stack JavaScript" |
| What is | "what is the call stack in JavaScript" |
| How does | "how does the call stack work" |
| Error | "call stack overflow JavaScript", "maximum call stack size exceeded" |
| Visual | "call stack explained", "call stack visualization" |
</Accordion>
</AccordionGroup>
每个概念页面都针对一个关键词集群——相关搜索查询的集合。写作前,先确定你的概念对应的关键词集群:
| 关键词类型 | 模式 | 示例(DOM) |
|---|---|---|
| 主关键词 | [概念] + JavaScript | "DOM JavaScript", "JavaScript DOM" |
| 定义类 | what is [concept] in JavaScript | "what is the DOM in JavaScript" |
| 原理类 | how does [concept] work | "how does the DOM work in JavaScript" |
| 操作类 | how to [action] with [concept] | "how to manipulate the DOM" |
| 教程类 | [concept] tutorial/guide/explained | "DOM tutorial JavaScript" |
| 对比类 | [concept] vs [related] | "DOM vs virtual DOM" |
更多关键词集群示例:
<AccordionGroup>
<Accordion title="闭包关键词集群">
| 类型 | 关键词 |
|------|----------|
| 主关键词 | "JavaScript closures", "closures in JavaScript" |
| 定义类 | "what is a closure in JavaScript", "what are closures" |
| 原理类 | "how do closures work in JavaScript", "how closures work" |
| 应用类 | "why use closures JavaScript", "closure use cases" |
| 示例类 | "JavaScript closure example", "closure examples" |
| 面试类 | "closure interview questions JavaScript" |
</Accordion>
<Accordion title="Promises关键词集群">
| 类型 | 关键词 |
|------|----------|
| 主关键词 | "JavaScript Promises", "Promises in JavaScript" |
| 定义类 | "what is a Promise in JavaScript", "what are Promises" |
| 原理类 | "how do Promises work", "how Promises work JavaScript" |
| 操作类 | "how to use Promises", "how to chain Promises" |
| 对比类 | "Promises vs callbacks", "Promises vs async await" |
| 错误类 | "Promise error handling", "Promise catch" |
</Accordion>
<Accordion title="事件循环关键词集群">
| 类型 | 关键词 |
|------|----------|
| 主关键词 | "JavaScript event loop", "event loop JavaScript" |
| 定义类 | "what is the event loop in JavaScript" |
| 原理类 | "how does the event loop work", "how event loop works" |
| 可视化类 | "event loop explained", "event loop visualization" |
| 关联类 | "call stack and event loop", "task queue JavaScript" |
</Accordion>
<Accordion title="调用栈关键词集群">
| 类型 | 关键词 |
|------|----------|
| 主关键词 | "JavaScript call stack", "call stack JavaScript" |
| 定义类 | "what is the call stack in JavaScript" |
| 原理类 | "how does the call stack work" |
| 错误类 | "call stack overflow JavaScript", "maximum call stack size exceeded" |
| 可视化类 | "call stack explained", "call stack visualization" |
</Accordion>
</AccordionGroup>
Title Tag Optimization
标题标签优化
The frontmatter has two title fields:
- — The page's
titletag (SEO, appears in search results)<title> - — The sidebar navigation text (cleaner, no "JavaScript" since we're on a JS site)
sidebarTitle
The Two-Title Pattern:
mdx
---
title: "Closures: How Functions Remember Their Scope in JavaScript"
sidebarTitle: "Closures: How Functions Remember Their Scope"
---- ends with "in JavaScript" for SEO keyword placement
title - omits "JavaScript" for cleaner navigation
sidebarTitle
Rules:
- 50-60 characters ideal length for (Google truncates longer titles)
title - Concept name first — lead with the topic, "JavaScript" comes at the end
- Add a hook — what will the reader understand or be able to do?
- Be specific — generic titles don't rank
Title Formulas That Work:
title: "[Concept]: [What You'll Understand] in JavaScript"
sidebarTitle: "[Concept]: [What You'll Understand]"
title: "[Concept]: [Benefit or Outcome] in JavaScript"
sidebarTitle: "[Concept]: [Benefit or Outcome]"Title Examples:
| ❌ Bad | ✓ title (SEO) | ✓ sidebarTitle (Navigation) |
|---|---|---|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
Character Count Check:
Before finalizing, verify your length:
title- Under 50 chars: Consider adding more descriptive context
- 50-60 chars: Perfect length
- Over 60 chars: Will be truncated in search results — shorten it
前置元数据中有两个标题字段:
- — 页面的
title标签(用于SEO,出现在搜索结果中)<title> - — 侧边栏导航文本(更简洁,因我们是JS站点,无需重复"JavaScript")
sidebarTitle
双标题模式:
mdx
---
title: "Closures: How Functions Remember Their Scope in JavaScript"
sidebarTitle: "Closures: How Functions Remember Their Scope"
---- 以"in JavaScript"结尾,用于SEO关键词布局
title - 省略"JavaScript",让导航更简洁
sidebarTitle
规则:
- 理想长度为50-60字符(Google会截断更长的标题)
title - 先写概念名称 — 以主题开头,"JavaScript"放在末尾
- 添加钩子 — 说明读者将理解什么或能做什么
- 具体化 — 通用标题无法获得好排名
有效的标题公式:
title: "[概念]: [你将理解的内容] in JavaScript"
sidebarTitle: "[概念]: [你将理解的内容]"
title: "[概念]: [收益或成果] in JavaScript"
sidebarTitle: "[概念]: [收益或成果]"标题示例:
| ❌ 糟糕 | ✓ title(SEO优化) | ✓ sidebarTitle(导航优化) |
|---|---|---|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
字符数检查:
最终确定前,验证你的长度:
title- 少于50字符:考虑添加更多描述性内容
- 50-60字符:完美长度
- 超过60字符:会在搜索结果中被截断 — 请缩短
Meta Description Optimization
元描述优化
The field becomes the meta description — the snippet users see in search results. A compelling description increases click-through rate.
descriptionRules:
- 150-160 characters maximum (Google truncates longer descriptions)
- Include primary keyword in the first half
- Include secondary keywords naturally if space allows
- Start with an action word — "Learn", "Understand", "Discover" (avoid "Master" — sounds AI-generated)
- Promise specific value — what will they learn?
- End with a hook — give them a reason to click
Description Formula:
[Action word] [what the concept is] in JavaScript. [Specific things they'll learn]: [topic 1], [topic 2], and [topic 3].Description Examples:
| Concept | ❌ Too Short (Low CTR) | ✓ SEO-Optimized (150-160 chars) |
|---|---|---|
| DOM | | |
| Closures | | |
| Promises | | |
| Event Loop | | |
| Call Stack | | |
| this | | |
Character Count Check:
- Under 120 chars: You're leaving value on the table — add more specifics
- 150-160 chars: Optimal length
- Over 160 chars: Will be truncated — edit ruthlessly
description规则:
- 最多150-160字符(Google会截断更长的描述)
- 前半部分包含主关键词
- 如果空间允许,自然融入次要关键词
- 以动作词开头 — "Learn", "Understand", "Discover"(避免"Master" — 听起来像AI生成)
- 承诺具体价值 — 读者将学到什么?
- 以钩子结尾 — 给读者点击的理由
描述公式:
[动作词] JavaScript中的[概念定义]。[具体学习内容]: [主题1], [主题2], 和 [主题3]。描述示例:
| 概念 | ❌ 过短(低点击率) | ✓ SEO优化版(150-160字符) |
|---|---|---|
| DOM | | |
| 闭包 | | |
| Promises | | |
| 事件循环 | | |
| 调用栈 | | |
| this | | |
字符数检查:
- 少于120字符:你浪费了展示价值的机会 — 添加更多细节
- 150-160字符:最佳长度
- 超过160字符:会被截断 — 无情地编辑缩短
Keyword Placement Strategy
关键词布局策略
Keywords must appear in strategic locations — but always naturally. Keyword stuffing hurts rankings.
Priority Placement Locations:
| Priority | Location | How to Include |
|---|---|---|
| 🔴 Critical | Title | Primary keyword in first half |
| 🔴 Critical | Meta description | Primary keyword + 1-2 secondary |
| 🔴 Critical | First paragraph | Natural mention within first 100 words |
| 🟠 High | H2 headings | Question-format headings with keywords |
| 🟠 High | "What you'll learn" box | Topic-related phrases |
| 🟡 Medium | H3 subheadings | Related keywords and concepts |
| 🟡 Medium | Key Takeaways | Reinforce main keywords naturally |
| 🟢 Good | Alt text | If using images, include keywords |
Example: Keyword Placement for DOM Page
mdx
---
title: "DOM: How Browsers Represent Web Pages in JavaScript" ← 🔴 Primary: "in JavaScript" at end
sidebarTitle: "DOM: How Browsers Represent Web Pages" ← Sidebar: no "JavaScript"
description: "Learn how the DOM works in JavaScript. Understand ← 🔴 Primary: "DOM works in JavaScript"
how browsers represent HTML as a tree, select and manipulate ← 🔴 Secondary: "manipulate elements"
elements, traverse nodes, and optimize rendering."
---
How does JavaScript change what you see on a webpage? ← Hook question
The **Document Object Model (DOM)** is a programming interface ← 🔴 Primary keyword in first paragraph
for web documents. It represents your HTML as a **tree of
objects** that JavaScript can read and manipulate.
<Info>
**What you'll learn in this guide:** ← 🟠 Topic reinforcement
- What the DOM actually is
- How to select elements (getElementById vs querySelector) ← Secondary keywords
- How to traverse the DOM tree
- How to create, modify, and remove elements ← "DOM" implicit
- How browsers render the DOM (Critical Rendering Path)
</Info>关键词必须放在关键位置 — 但务必自然。关键词堆砌会损害排名。
优先级布局位置:
| 优先级 | 位置 | 如何融入 |
|---|---|---|
| 🔴 关键 | 标题 | 主关键词放在前半部分 |
| 🔴 关键 | 元描述 | 主关键词 + 1-2个次要关键词 |
| 🔴 关键 | 第一段 | 在前100个单词内自然提及 |
| 🟠 高 | H2标题 | 用包含关键词的问题式标题 |
| 🟠 高 | "你将学到什么"框 | 关联主题的短语 |
| 🟡 中 | H3子标题 | 相关关键词和概念 |
| 🟡 中 | 关键要点 | 自然强化主关键词 |
| 🟢 好 | 替代文本 | 如果使用图片,在替代文本中包含关键词 |
示例:DOM页面的关键词布局
mdx
---
title: "DOM: How Browsers Represent Web Pages in JavaScript" ← 🔴 主关键词:末尾的"in JavaScript"
sidebarTitle: "DOM: How Browsers Represent Web Pages" ← 侧边栏:无"JavaScript"
description: "Learn how the DOM works in JavaScript. Understand ← 🔴 主关键词:"DOM works in JavaScript"
how browsers represent HTML as a tree, select and manipulate ← 🔴 次要关键词:"manipulate elements"
elements, traverse nodes, and optimize rendering."
---
How does JavaScript change what you see on a webpage? ← 钩子问题
The **Document Object Model (DOM)** is a programming interface ← 🔴 第一段出现主关键词
for web documents. It represents your HTML as a **tree of
objects** that JavaScript can read and manipulate.
<Info>
**What you'll learn in this guide:** ← 🟠 主题强化
- What the DOM actually is
- How to select elements (getElementById vs querySelector) ← 次要关键词
- How to traverse the DOM tree
- How to create, modify, and remove elements ← 隐含"DOM"
- How browsers render the DOM (Critical Rendering Path)
</Info>What is the DOM in JavaScript? ← 🟠 H2 with question keyword
What is the DOM in JavaScript? ← 🟠 包含问题式关键词的H2
The DOM (Document Object Model) is... ← Natural repetition
The DOM (Document Object Model) is... ← 自然重复关键词
How the DOM Works ← 🟠 H2 with "how" keyword
How the DOM Works ← 🟠 包含"how"的关键词H2
DOM Manipulation Methods ← 🟡 H3 with related keyword
DOM Manipulation Methods ← 🟡 包含相关关键词的H3
Key Takeaways ← 🟡 Reinforce in summary
Key Takeaways ← 🟡 在总结中强化关键词
**Warning Signs of Keyword Stuffing:**
- Same exact phrase appears more than 3-4 times per 1000 words
- Sentences read awkwardly because keywords were forced in
- Using keywords where pronouns ("it", "they", "this") would be natural
---
**关键词堆砌的警告信号:**
- 每1000单词中同一短语出现超过3-4次
- 为了加入关键词,句子读起来很别扭
- 本该用代词("it", "they", "this")的地方却用了关键词
---Answering Search Intent
满足搜索意图
Google ranks pages that directly answer the user's query. Structure your content to satisfy search intent immediately.
The First Paragraph Rule:
The first paragraph after any H2 should directly answer the implied question. Don't build up to the answer — lead with it.
mdx
<!-- ❌ BAD: Builds up to the answer -->Google会优先排名直接回答用户查询的页面。调整你的内容结构,立即满足搜索意图。
H2后第一段规则:
任何H2后的第一段都应直接回答隐含的问题。不要铺垫,直接给出答案。
mdx
<!-- ❌ 糟糕:铺垫后才给出答案 -->What is the Event Loop?
What is the Event Loop?
Before we can understand the event loop, we need to talk about JavaScript's
single-threaded nature. You see, JavaScript can only do one thing at a time,
and this creates some interesting challenges. The way JavaScript handles
this is through something called... the event loop.
<!-- ✓ GOOD: Answers immediately -->Before we can understand the event loop, we need to talk about JavaScript's
single-threaded nature. You see, JavaScript can only do one thing at a time,
and this creates some interesting challenges. The way JavaScript handles
this is through something called... the event loop.
<!-- ✓ 优秀:立即给出答案 -->What is the Event Loop?
What is the Event Loop?
The event loop is JavaScript's mechanism for executing code, handling events,
and managing asynchronous operations. It continuously monitors the call stack
and task queue, moving queued callbacks to the stack when it's empty — this is
how JavaScript handles async code despite being single-threaded.
**Question-Format H2 Headings:**
Use H2s that match how people search:
| Search Query | H2 to Use |
|--------------|-----------|
| "what is the DOM" | `## What is the DOM?` |
| "how closures work" | `## How Do Closures Work?` |
| "why use promises" | `## Why Use Promises?` |
| "when to use async await" | `## When Should You Use async/await?` |
---The event loop is JavaScript's mechanism for executing code, handling events,
and managing asynchronous operations. It continuously monitors the call stack
and task queue, moving queued callbacks to the stack when it's empty — this is
how JavaScript handles async code despite being single-threaded.
**问题式H2标题:**
使用符合用户搜索方式的H2标题:
| 搜索查询 | 推荐使用的H2 |
|--------------|-----------|
| "what is the DOM" | `## What is the DOM?` |
| "how closures work" | `## How Do Closures Work?` |
| "why use promises" | `## Why Use Promises?` |
| "when to use async await" | `## When Should You Use async/await?` |
---Featured Snippet Optimization
特色摘要优化
Featured snippets appear at position zero — above all organic results. Structure your content to win them.
Snippet Types and How to Win Them:
┌─────────────────────────────────────────────────────────────────────────┐
│ FEATURED SNIPPET TYPES │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ QUERY TYPE SNIPPET FORMAT YOUR CONTENT STRUCTURE │
│ ─────────── ────────────── ───────────────────────── │
│ │
│ "What is X" Paragraph 40-60 word definition │
│ immediately after H2 │
│ │
│ "How to X" Numbered list <Steps> component or │
│ numbered Markdown list │
│ │
│ "X vs Y" Table Comparison table with │
│ clear column headers │
│ │
│ "Types of X" Bulleted list Bullet list under │
│ descriptive H2 │
│ │
│ "[X] examples" Bulleted list or Code examples with │
│ code block brief explanations │
│ │
└─────────────────────────────────────────────────────────────────────────┘Pattern 1: Definition Snippet (40-60 words)
For "what is [concept]" queries:
mdx
undefined特色摘要出现在第0位 — 所有自然搜索结果之上。调整内容结构以获得特色摘要。
摘要类型及获取方法:
┌─────────────────────────────────────────────────────────────────────────┐
│ 特色摘要类型 │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ 查询类型 摘要格式 你的内容结构 │
│ ─────────── ────────────── ───────────────────────── │
│ │
│ "What is X" 段落 H2后紧跟40-60词的定义 │
│ │
│ "How to X" 编号列表 使用<Steps>组件或编号Markdown列表 │
│ │
│ "X vs Y" 表格 带清晰列标题的对比表 │
│ │
│ "Types of X" 项目符号列表 描述性H2下的项目符号列表 │
│ │
│ "[X] examples" 项目符号列表或 带简短解释的代码示例 │
│ 代码块 │
│ │
└─────────────────────────────────────────────────────────────────────────┘模式1:定义类摘要(40-60词)
针对"what is [concept]"类查询:
mdx
undefinedWhat is a Closure in JavaScript?
What is a Closure in JavaScript?
A closure is a function that retains access to variables from its outer
(enclosing) scope, even after that outer function has finished executing.
Closures are created every time a function is created in JavaScript, allowing
inner functions to "remember" and access their lexical environment.
**Why this wins:**
- H2 matches search query exactly
- Bold keyword in first sentence
- 40-60 word complete definition
- Explains the "why" not just the "what"
**Pattern 2: List Snippet (Steps)**
For "how to [action]" queries:
```mdxA closure is a function that retains access to variables from its outer
(enclosing) scope, even after that outer function has finished executing.
Closures are created every time a function is created in JavaScript, allowing
inner functions to "remember" and access their lexical environment.
**为何能获得特色摘要:**
- H2与搜索查询完全匹配
- 首句加粗关键词
- 40-60词的完整定义
- 不仅解释了"是什么",还解释了"为什么"
**模式2:列表类摘要(步骤)**
针对"how to [action]"类查询:
```mdxHow to Make a Fetch Request in JavaScript
How to Make a Fetch Request in JavaScript
<Steps>
<Step title="1. Call fetch() with the URL">
The `fetch()` function takes a URL and returns a Promise that resolves to a Response object.
</Step>
<Step title="2. Check if the response was successful">
Always verify `response.ok` before processing — fetch doesn't throw on HTTP errors.
</Step>
<Step title="3. Parse the response body">
Use `response.json()` for JSON data, `response.text()` for plain text.
</Step>
<Step title="4. Handle errors properly">
Wrap everything in try/catch to handle both network and HTTP errors.
</Step>
</Steps>
```
Pattern 3: Table Snippet (Comparison)
For "[X] vs [Y]" queries:
mdx
undefined<Steps>
<Step title="1. Call fetch() with the URL">
The `fetch()` function takes a URL and returns a Promise that resolves to a Response object.
</Step>
<Step title="2. Check if the response was successful">
Always verify `response.ok` before processing — fetch doesn't throw on HTTP errors.
</Step>
<Step title="3. Parse the response body">
Use `response.json()` for JSON data, `response.text()` for plain text.
</Step>
<Step title="4. Handle errors properly">
Wrap everything in try/catch to handle both network and HTTP errors.
</Step>
</Steps>
```
模式3:表格类摘要(对比)
针对"[X] vs [Y]"类查询:
mdx
undefined== vs === in JavaScript
== vs === in JavaScript
| Aspect | | |
|---|---|---|
| Type coercion | Yes — converts types before comparing | No — types must match |
| Speed | Slower (coercion overhead) | Faster (no coercion) |
| Predictability | Can produce surprising results | Always predictable |
| Recommendation | Avoid in most cases | Use by default |
javascript
// Examples
5 == "5" // true (string coerced to number)
5 === "5" // false (different types)
**Pattern 4: List Snippet (Types/Categories)**
For "types of [concept]" queries:
```mdx| 方面 | | |
|---|---|---|
| 类型转换 | 是 — 比较前转换类型 | 否 — 类型必须匹配 |
| 速度 | 较慢(类型转换开销) | 较快(无类型转换) |
| 可预测性 | 可能产生意外结果 | 始终可预测 |
| 推荐 | 大多数场景避免使用 | 默认使用 |
javascript
// 示例
5 == "5" // true(字符串转换为数字)
5 === "5" // false(类型不同)
**模式4:列表类摘要(类型/分类)**
针对"types of [concept]"类查询:
```mdxTypes of Scope in JavaScript
Types of Scope in JavaScript
JavaScript has three types of scope that determine where variables are accessible:
- Global Scope — Variables declared outside any function or block; accessible everywhere
- Function Scope — Variables declared inside a function with ; accessible only within that function
var - Block Scope — Variables declared with or
letinsideconst; accessible only within that block{}
---JavaScript has three types of scope that determine where variables are accessible:
- Global Scope — 在任何函数或块外声明的变量;可在任何地方访问
- Function Scope — 用在函数内声明的变量;仅能在该函数内访问
var - Block Scope — 用或
let在const内声明的变量;仅能在该块内访问{}
---Content Structure for SEO
SEO内容结构
How you structure content affects both rankings and user experience.
The Inverted Pyramid:
Put the most important information first. Search engines and users both prefer content that answers questions immediately.
┌─────────────────────────────────────────────────────────────────────────┐
│ THE INVERTED PYRAMID │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ │
│ ┌─────────────────────────────────────┐ │
│ │ ANSWER THE QUESTION │ ← First 100 words │
│ │ Definition + Core Concept │ (most important) │
│ └──────────────────┬──────────────────┘ │
│ │ │
│ ┌────────────────┴────────────────┐ │
│ │ EXPLAIN HOW IT WORKS │ ← Next 300 words │
│ │ Mechanism + Visual Diagram │ (supporting info) │
│ └────────────────┬─────────────────┘ │
│ │ │
│ ┌──────────────────┴──────────────────┐ │
│ │ SHOW PRACTICAL EXAMPLES │ ← Code examples │
│ │ Code + Step-by-step │ (proof it works) │
│ └──────────────────┬──────────────────┘ │
│ │ │
│ ┌──────────────────────┴──────────────────────┐ │
│ │ COVER EDGE CASES │ ← Advanced │
│ │ Common mistakes, gotchas │ (depth) │
│ └──────────────────────┬──────────────────────┘ │
│ │ │
│ ┌──────────────────────────┴──────────────────────────┐ │
│ │ ADDITIONAL RESOURCES │ ← External │
│ │ Related concepts, articles, videos │ (links) │
│ └──────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘Scannable Content Patterns:
Google favors content that's easy to scan. Use these elements:
| Element | SEO Benefit | When to Use |
|---|---|---|
| Short paragraphs | Reduces bounce rate | Always (2-4 sentences max) |
| Bullet lists | Often become featured snippets | Lists of 3+ items |
| Numbered lists | "How to" snippet potential | Sequential steps |
| Tables | High snippet potential | Comparisons, reference data |
| Bold text | Highlights keywords for crawlers | First mention of key terms |
| Headings (H2/H3) | Structure signals to Google | Every major topic shift |
Content Length Guidelines:
| Length | Assessment | Action |
|---|---|---|
| Under 1,000 words | Too thin | Add more depth, examples, edge cases |
| 1,000-1,500 words | Minimum viable | Acceptable for simple concepts |
| 1,500-2,500 words | Good | Standard for most concept pages |
| 2,500-4,000 words | Excellent | Ideal for comprehensive guides |
| Over 4,000 words | Evaluate | Consider splitting into multiple pages |
Note: Length alone doesn't guarantee rankings. Every section must add value — don't pad content.
内容结构会影响排名和用户体验。
倒金字塔结构:
把最重要的信息放在前面。搜索引擎和用户都喜欢能立即回答问题的内容。
┌─────────────────────────────────────────────────────────────────────────┐
│ 倒金字塔结构 │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ │
│ ┌─────────────────────────────────────┐ │
│ │ 回答问题 │ ← 前100词 │
│ │ 定义 + 核心概念 │ (最重要) │
│ └──────────────────┬──────────────────┘ │
│ │ │
│ ┌────────────────┴────────────────┐ │
│ │ 解释工作原理 │ ← 接下来300词 │
│ │ 机制 + 可视化图 │ (支撑信息) │
│ └────────────────┬─────────────────┘ │
│ │ │
│ ┌──────────────────┴──────────────────┐ │
│ │ 展示实际示例 │ ← 代码示例 │
│ │ 代码 + 分步讲解 │ (证明可行) │
│ └──────────────────┬──────────────────┘ │
│ │ │
│ ┌──────────────────────┴──────────────────────┐ │
│ │ 覆盖边缘情况 │ ← 进阶内容 │
│ │ 常见错误、陷阱 │ (深度) │
│ └──────────────────────┬──────────────────────┘ │
│ │ │
│ ┌──────────────────────────┴──────────────────────────┐ │
│ │ 附加资源 │ ← 外部链接 │
│ │ 相关概念、文章、视频 │ (链接) │
│ └──────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘易于扫描的内容模式:
Google偏爱易于扫描的内容。使用以下元素:
| 元素 | SEO益处 | 使用场景 |
|---|---|---|
| 短段落 | 降低跳出率 | 始终使用(最多2-4句) |
| 项目符号列表 | 常被选为特色摘要 | 3项以上的列表 |
| 编号列表 | 有机会成为"How to"类摘要 | 顺序步骤 |
| 表格 | 高摘要潜力 | 对比、参考数据 |
| 粗体文本 | 为爬虫突出关键词 | 关键术语首次提及 |
| 标题(H2/H3) | 向Google传递结构信号 | 每次主题切换时 |
内容长度指南:
| 长度 | 评估 | 操作 |
|---|---|---|
| 少于1000词 | 内容过浅 | 添加更多深度内容、示例、边缘情况 |
| 1000-1500词 | 最低可行长度 | 简单概念可接受 |
| 1500-2500词 | 良好 | 大多数概念页面的标准长度 |
| 2500-4000词 | 优秀 | 全面指南的理想长度 |
| 超过4000词 | 评估 | 考虑拆分为多个页面 |
注意: 长度本身并不能保证排名。每个章节都必须有价值 — 不要凑字数。
Internal Linking for SEO
SEO内部链接
Internal links help search engines understand your site structure and distribute page authority.
Topic Cluster Strategy:
Think of concept pages as an interconnected network. Every concept should link to 3-5 related concepts:
┌─────────────────┐
┌───────│ Promises │───────┐
│ └────────┬────────┘ │
│ │ │
▼ ▼ ▼
┌───────────┐ ┌───────────────┐ ┌─────────────┐
│async/await│◄──►│ Event Loop │◄──►│ Callbacks │
└───────────┘ └───────────────┘ └─────────────┘
│ │ │
│ ▼ │
│ ┌───────────────┐ │
└──────►│ Call Stack │◄───────┘
└───────────────┘Link Placement Guidelines:
- In Prerequisites (Warning box):
mdx
<Warning>
**Prerequisite:** This guide assumes you understand [Promises](/concepts/promises) and the [Event Loop](/concepts/event-loop). Read those first if you're not comfortable with asynchronous JavaScript.
</Warning>- In Body Content (natural context):
mdx
When the callback finishes, it's added to the task queue — which is managed by the [event loop](/concepts/event-loop).- In Related Concepts Section:
mdx
<CardGroup cols={2}>
<Card title="Promises" icon="handshake" href="/concepts/promises">
async/await is built on top of Promises
</Card>
<Card title="Event Loop" icon="arrows-spin" href="/concepts/event-loop">
How JavaScript manages async operations
</Card>
</CardGroup>Anchor Text Best Practices:
| ❌ Bad Anchor Text | ✓ Good Anchor Text | Why |
|---|---|---|
| "click here" | "event loop guide" | Descriptive, includes keyword |
| "this article" | "our Promises concept" | Tells Google what page is about |
| "here" | "JavaScript closures" | Keywords in anchor text |
| "read more" | "understanding the call stack" | Natural, informative |
内部链接帮助搜索引擎理解你的网站结构,并分配页面权重。
主题集群策略:
把概念页面视为一个互联的网络。每个概念都应链接到3-5个相关概念:
┌─────────────────┐
┌───────│ Promises │───────┐
│ └────────┬────────┘ │
│ │ │
▼ ▼ ▼
┌───────────┐ ┌───────────────┐ ┌─────────────┐
│async/await│◄──►│ Event Loop │◄──►│ Callbacks │
└───────────┘ └───────────────┘ └─────────────┘
│ │ │
│ ▼ │
│ ┌───────────────┐ │
└──────►│ Call Stack │◄───────┘
└───────────────┘链接布局指南:
- 前置知识(Warning框):
mdx
<Warning>
**Prerequisite:** This guide assumes you understand [Promises](/concepts/promises) and the [Event Loop](/concepts/event-loop). Read those first if you're not comfortable with asynchronous JavaScript.
</Warning>- 正文内容(自然语境):
mdx
When the callback finishes, it's added to the task queue — which is managed by the [event loop](/concepts/event-loop).- 相关概念章节:
mdx
<CardGroup cols={2}>
<Card title="Promises" icon="handshake" href="/concepts/promises">
async/await is built on top of Promises
</Card>
<Card title="Event Loop" icon="arrows-spin" href="/concepts/event-loop">
How JavaScript manages async operations
</Card>
</CardGroup>锚文本最佳实践:
| ❌ 糟糕的锚文本 | ✓ 良好的锚文本 | 原因 |
|---|---|---|
| "click here" | "event loop guide" | 描述性,包含关键词 |
| "this article" | "our Promises concept" | 告诉Google页面内容 |
| "here" | "JavaScript closures" | 锚文本包含关键词 |
| "read more" | "understanding the call stack" | 自然、信息丰富 |
URL and Slug Best Practices
URL和Slug最佳实践
URLs (slugs) are a minor but meaningful ranking factor.
Rules:
- Use lowercase — not
closuresClosures - Use hyphens — not
call-stackorcall_stackcallstack - Keep it short — aim for 3-5 words maximum
- Include primary keyword — the concept name
- Avoid stop words — skip "the", "and", "in", "of" unless necessary
Slug Examples:
| Concept | ❌ Avoid | ✓ Use |
|---|---|---|
| The Event Loop | | |
| this, call, apply and bind | | |
| Scope and Closures | | |
| DOM and Layout Trees | | |
Note: For this project, slugs are already set. When creating new pages, follow these conventions.
URL(Slug)是一个次要但有意义的排名因素。
规则:
- 使用小写 — 而非
closuresClosures - 使用连字符 — 而非
call-stack或call_stackcallstack - 保持简短 — 目标最多3-5词
- 包含主关键词 — 概念名称
- 避免停用词 — 除非必要,跳过"the", "and", "in", "of"
Slug示例:
| 概念 | ❌ 避免 | ✓ 使用 |
|---|---|---|
| The Event Loop | | |
| this, call, apply and bind | | |
| Scope and Closures | | |
| DOM and Layout Trees | | |
注意: 本项目的Slug已设置完成。创建新页面时,请遵循这些约定。
Opening Paragraph: The SEO Power Move
开篇段落:SEO制胜关键
The opening paragraph is prime SEO real estate. It should:
- Hook the reader with a question they're asking
- Include the primary keyword naturally
- Provide a brief definition or answer
- Set up what they'll learn
Template:
mdx
[Question hook that matches search intent?] [Maybe another question?]
The **[Primary Keyword]** is [brief definition that answers "what is X"].
[One sentence explaining why it matters or what it enables].
```javascript
// Immediately show a simple example[Brief transition to "What you'll learn" box]
**Example (Closures):**
```mdx
Why do some functions seem to "remember" variables that should have disappeared?
How can a callback still access variables from a function that finished running
long ago?
The answer is **closures** — one of JavaScript's most powerful (and often
misunderstood) features. A closure is a function that retains access to its
outer scope's variables, even after that outer scope has finished executing.
```javascript
function createCounter() {
let count = 0 // This variable is "enclosed" by the returned function
return function() {
count++
return count
}
}
const counter = createCounter()
console.log(counter()) // 1
console.log(counter()) // 2 — it remembers!Understanding closures unlocks patterns like private variables, factory functions,
and the module pattern that power modern JavaScript.
**Why this works for SEO:**
- Question hooks match how people search ("why do functions remember")
- Bold keyword in first paragraph
- Direct definition answers "what is a closure"
- Code example demonstrates immediately
- Natural setup for learning objectives
---开篇段落是SEO的黄金位置。它应:
- 用读者正在问的问题吸引他们
- 自然包含主关键词
- 提供简短定义或答案
- 介绍读者将学到的内容
模板:
mdx
[符合搜索意图的问题钩子?] [可能还有另一个问题?]
The **[主关键词]** 是 [回答"X是什么"的简短定义]。
[解释其重要性或作用的一句话]。
```javascript
// 立即展示简单示例[简短过渡到"你将学到什么"框]
**示例(闭包):**
```mdx
Why do some functions seem to "remember" variables that should have disappeared?
How can a callback still access variables from a function that finished running
long ago?
答案是**闭包** — JavaScript最强大(也常被误解)的特性之一。闭包是指即使外部函数执行完毕,内部函数仍能访问其外部作用域变量的函数。
```javascript
function createCounter() {
let count = 0 // 这个变量被返回的函数"包裹"了
return function() {
count++
return count
}
}
const counter = createCounter()
console.log(counter()) // 1
console.log(counter()) // 2 — 它记住了!理解闭包能解锁私有变量、工厂函数和模块模式等现代JavaScript的核心模式。
**为何对SEO有效:**
- 问题钩子匹配用户搜索方式("why do functions remember")
- 第一段加粗关键词
- 直接定义回答了"什么是闭包"
- 代码示例立即演示
- 自然引出学习目标
---Inline Linking Rules (Critical!)
内嵌链接规则(关键!)
Always Link to MDN
始终链接到MDN
Whenever you introduce a new Web API, method, object, or JavaScript concept, link to MDN immediately. This gives readers a path to deeper learning.
mdx
<!-- ✓ CORRECT: Link on first mention -->
The **[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)** is JavaScript's modern way to make network requests.
The **[Response](https://developer.mozilla.org/en-US/docs/Web/API/Response)** object contains everything about the server's reply.
Most modern APIs return data in **[JSON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON)** format.
<!-- ❌ WRONG: No links -->
The Fetch API is JavaScript's modern way to make network requests.每当你引入新的Web API、方法、对象或JavaScript概念时,立即链接到MDN。这为读者提供了深入学习的途径。
mdx
<!-- ✓ 正确:首次提及添加链接 -->
The **[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)** 是JavaScript中发起网络请求的现代方式。
The **[Response](https://developer.mozilla.org/en-US/docs/Web/API/Response)** 对象包含了服务器响应的所有信息。
大多数现代API以**[JSON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON)**格式返回数据。
<!-- ❌ 错误:无链接 -->
The Fetch API是JavaScript中发起网络请求的现代方式。Link to Related Concept Pages
链接到相关概念页面
When mentioning concepts covered in other pages, link to them:
mdx
<!-- ✓ CORRECT: Internal links to related concepts -->
If you're not familiar with it, check out our [async/await concept](/concepts/async-await) first.
This guide assumes you understand [Promises](/concepts/promises).
<!-- ❌ WRONG: No internal links -->
If you're not familiar with async/await, you should learn that first.当提及其他页面涵盖的概念时,链接到对应页面:
mdx
<!-- ✓ 正确:内部链接到相关概念 -->
如果你不熟悉它,请先查看我们的[async/await概念](/concepts/async-await)。
本指南假设你已理解[Promises](/concepts/promises)。
<!-- ❌ 错误:无内部链接 -->
如果你不熟悉async/await,应该先学习它。Common MDN Link Patterns
常见MDN链接模式
| Concept | MDN URL Pattern |
|---|---|
| Web APIs | |
| JavaScript Objects | |
| HTTP | |
| HTTP Methods | |
| HTTP Headers | |
| 概念 | MDN URL模式 |
|---|---|
| Web APIs | |
| JavaScript对象 | |
| HTTP | |
| HTTP方法 | |
| HTTP头 | |
Code Examples Best Practices
代码示例最佳实践
1. Start with the Simplest Possible Example
1. 从最简单的示例开始
javascript
// ✓ GOOD: Start with the absolute basics
// This is how you fetch data in JavaScript
const response = await fetch('https://api.example.com/users/1')
const user = await response.json()
console.log(user.name) // "Alice"javascript
// ✓ 良好:从最基础的内容开始
// 这是你在JavaScript中获取数据的方式
const response = await fetch('https://api.example.com/users/1')
const user = await response.json()
console.log(user.name) // "Alice"2. Use Step-by-Step Comments
2. 使用分步注释
javascript
// Step 1: fetch() returns a Promise that resolves to a Response object
const responsePromise = fetch('https://api.example.com/users')
// Step 2: When the response arrives, we get a Response object
responsePromise.then(response => {
console.log(response.status) // 200
// Step 3: The body is a stream, we need to parse it
return response.json()
})
.then(data => {
// Step 4: Now we have the actual data
console.log(data)
})javascript
// 步骤1: fetch()返回一个解析为Response对象的Promise
const responsePromise = fetch('https://api.example.com/users')
// 步骤2: 响应到达后,我们得到一个Response对象
responsePromise.then(response => {
console.log(response.status) // 200
// 步骤3: 响应体是流,我们需要解析它
return response.json()
})
.then(data => {
// 步骤4: 现在我们得到了实际数据
console.log(data)
})3. Show Output in Comments
3. 在注释中展示输出
javascript
const greeting = "Hello"
console.log(typeof greeting) // "string"
const numbers = [1, 2, 3]
console.log(numbers.length) // 3javascript
const greeting = "Hello"
console.log(typeof greeting) // "string"
const numbers = [1, 2, 3]
console.log(numbers.length) // 34. Use ❌ and ✓ for Wrong/Correct Patterns
4. 用❌和✓标记错误/正确模式
javascript
// ❌ WRONG - This misses HTTP errors!
try {
const response = await fetch('/api/users/999')
const data = await response.json()
} catch (error) {
// Only catches NETWORK errors, not 404s!
}
// ✓ CORRECT - Check response.ok
try {
const response = await fetch('/api/users/999')
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`)
}
const data = await response.json()
} catch (error) {
// Now catches both network AND HTTP errors
}javascript
// ❌ 错误 - 这会遗漏HTTP错误!
try {
const response = await fetch('/api/users/999')
const data = await response.json()
} catch (error) {
// 仅捕获网络错误,不捕获404!
}
// ✓ 正确 - 检查response.ok
try {
const response = await fetch('/api/users/999')
if (!response.ok) {
throw new Error(`HTTP错误!状态码: ${response.status}`)
}
const data = await response.json()
} catch (error) {
// 现在同时捕获网络和HTTP错误
}5. Use Meaningful Variable Names
5. 使用有意义的变量名
javascript
// ❌ BAD
const x = [1, 2, 3]
const y = x.map(z => z * 2)
// ✓ GOOD
const numbers = [1, 2, 3]
const doubled = numbers.map(num => num * 2)javascript
// ❌ 糟糕
const x = [1, 2, 3]
const y = x.map(z => z * 2)
// ✓ 良好
const numbers = [1, 2, 3]
const doubled = numbers.map(num => num * 2)6. Progress from Simple to Complex
6. 从简单到复杂逐步推进
javascript
// Level 1: Basic usage
fetch('/api/users')
// Level 2: With options
fetch('/api/users', {
method: 'POST',
body: JSON.stringify({ name: 'Alice' })
})
// Level 3: Full real-world pattern
async function createUser(userData) {
const response = await fetch('/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(userData)
})
if (!response.ok) {
throw new Error(`Failed to create user: ${response.status}`)
}
return response.json()
}javascript
// 级别1: 基础用法
fetch('/api/users')
// 级别2: 带选项
fetch('/api/users', {
method: 'POST',
body: JSON.stringify({ name: 'Alice' })
})
// 级别3: 完整的实际场景模式
async function createUser(userData) {
const response = await fetch('/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(userData)
})
if (!response.ok) {
throw new Error(`创建用户失败: ${response.status}`)
}
return response.json()
}Resource Curation Guidelines
资源筛选指南
External resources (articles, videos) are valuable, but must meet quality standards.
外部资源(文章、视频)很有价值,但必须符合质量标准。
Quality Standards
质量标准
Only include resources that are:
- JavaScript-focused — No resources primarily about other languages (C#, Python, Java, etc.), even if the concepts are similar
- Still accessible — Verify all links work before publishing
- High quality — From reputable sources (MDN, javascript.info, freeCodeCamp, well-known educators)
- Up to date — Avoid outdated resources; check publication dates for time-sensitive topics
- Accurate — Skim the content to verify it doesn't teach anti-patterns
仅包含符合以下条件的资源:
- 聚焦JavaScript — 不包含主要关于其他语言(C#, Python, Java等)的资源,即使概念相似
- 可访问 — 发布前验证所有链接可用
- 高质量 — 来自权威来源(MDN, javascript.info, freeCodeCamp, 知名教育者)
- 最新 — 避免过时资源;对时效性强的主题,检查发布日期
- 准确 — 浏览内容以确认未传授不良模式
Writing Resource Descriptions
编写资源描述
Each resource needs a specific, engaging 2-sentence description explaining what makes it unique. Generic descriptions waste the reader's time.
mdx
<!-- ❌ Generic (bad) -->
<Card title="JavaScript Promises Tutorial" icon="newspaper" href="...">
Learn about Promises in JavaScript.
</Card>
<!-- ❌ Generic (bad) -->
<Card title="Async/Await Explained" icon="newspaper" href="...">
A comprehensive guide to async/await.
</Card>
<!-- ✓ Specific (good) -->
<Card title="JavaScript Async/Await Tutorial" icon="newspaper" href="https://javascript.info/async-await">
The go-to reference for async/await fundamentals. Includes exercises at the end to test your understanding of rewriting promise chains.
</Card>
<!-- ✓ Specific (good) -->
<Card title="JavaScript Visualized: Promises & Async/Await" icon="newspaper" href="...">
Animated GIFs showing the call stack, microtask queue, and event loop in action. This is how async/await finally "clicked" for thousands of developers.
</Card>
<!-- ✓ Specific (good) -->
<Card title="How to Escape Async/Await Hell" icon="newspaper" href="...">
The pizza-and-drinks ordering example makes parallel vs sequential execution crystal clear. Essential reading once you know the basics.
</Card>Description Formula:
- Sentence 1: What makes this resource unique OR what it specifically covers
- Sentence 2: Why a reader should click (what they'll gain, who it's best for, what stands out)
Avoid in descriptions:
- "Comprehensive guide to..." (vague)
- "Great tutorial on..." (vague)
- "Learn all about..." (vague)
- "Everything you need to know about..." (cliché)
每个资源都需要一个具体、吸引人的2句话描述,解释其独特之处。通用描述是在浪费读者时间。
mdx
<!-- ❌ 通用(糟糕) -->
<Card title="JavaScript Promises Tutorial" icon="newspaper" href="...">
Learn about Promises in JavaScript.
</Card>
<!-- ❌ 通用(糟糕) -->
<Card title="Async/Await Explained" icon="newspaper" href="...">
A comprehensive guide to async/await.
</Card>
<!-- ✓ 具体(良好) -->
<Card title="JavaScript Async/Await Tutorial" icon="newspaper" href="https://javascript.info/async-await">
学习async/await基础知识的首选参考资料。末尾包含练习,测试你重写Promise链的理解程度。
</Card>
<!-- ✓ 具体(良好) -->
<Card title="JavaScript Visualized: Promises & Async/Await" icon="newspaper" href="...">
用动画GIF展示调用栈、微任务队列和事件循环的运行过程。这让数千名开发者终于理解了async/await的工作原理。
</Card>
<!-- ✓ 具体(良好) -->
<Card title="How to Escape Async/Await Hell" icon="newspaper" href="...">
披萨和饮料订单的示例让并行与顺序执行的区别变得清晰明了。掌握基础知识后必读的内容。
</Card>描述公式:
- 第一句: 该资源的独特之处或具体涵盖的内容
- 第二句: 读者为何应该点击(将获得什么、适合谁、突出点是什么)
描述中避免:
- "Comprehensive guide to..."(模糊)
- "Great tutorial on..."(模糊)
- "Learn all about..."(模糊)
- "Everything you need to know about..."(陈词滥调)
Recommended Sources
推荐来源
Articles (Prioritize):
| Source | Why |
|---|---|
| javascript.info | Comprehensive, well-maintained, exercises included |
| MDN Web Docs | Official reference, always accurate |
| freeCodeCamp | Beginner-friendly, practical tutorials |
| dev.to (Lydia Hallie, etc.) | Visual explanations, community favorites |
| CSS-Tricks | DOM, browser APIs, visual topics |
Videos (Prioritize):
| Creator | Style |
|---|---|
| Web Dev Simplified | Clear, beginner-friendly, concise |
| Fireship | Fast-paced, modern, entertaining |
| Traversy Media | Comprehensive crash courses |
| Fun Fun Function | Deep-dives with personality |
| Wes Bos | Practical, real-world focused |
Avoid:
- Resources in other programming languages (C#, Python, Java) even if concepts overlap
- Outdated tutorials (pre-ES6 syntax for modern concepts)
- Paywalled content (unless there's a free tier)
- Low-quality Medium articles (check engagement and accuracy)
- Resources that teach anti-patterns
- Videos over 2 hours (link to specific timestamps if valuable)
文章(优先):
| 来源 | 原因 |
|---|---|
| javascript.info | 内容全面、维护良好、包含练习 |
| MDN Web Docs | 官方参考资料,始终准确 |
| freeCodeCamp | 适合初学者、实用教程 |
| dev.to(Lydia Hallie等) | 可视化解释、社区热门 |
| CSS-Tricks | DOM、浏览器API、可视化主题 |
视频(优先):
| 创作者 | 风格 |
|---|---|
| Web Dev Simplified | 清晰、适合初学者、简洁 |
| Fireship | 节奏快、现代、有趣 |
| Traversy Media | 全面的速成课程 |
| Fun Fun Function | 有深度、有个性 |
| Wes Bos | 实用、聚焦实际场景 |
避免:
- 其他编程语言的资源(C#, Python, Java)即使概念重叠
- 过时教程(现代概念使用ES6前的语法)
- 付费内容(除非有免费版本)
- 低质量Medium文章(查看互动量和准确性)
- 传授不良模式的资源
- 超过2小时的视频(如有价值,链接到特定时间戳)
Verifying Resources
验证资源
Before including any resource:
- Click the link — Verify it loads and isn't behind a paywall
- Skim the content — Ensure it's accurate and well-written
- Check the date — For time-sensitive topics, prefer recent content
- Read comments/reactions — Community feedback reveals quality issues
- Test code examples — If they include code, verify it works
包含任何资源前:
- 点击链接 — 验证可加载且无付费墙
- 浏览内容 — 确保准确且写得好
- 检查日期 — 对时效性强的主题,优先选择近期内容
- 阅读评论/反馈 — 社区反馈能揭示质量问题
- 测试代码示例 — 如果包含代码,验证可运行
ASCII Art Diagrams
ASCII艺术图
Use ASCII art to visualize concepts. Make them boxed and labeled:
┌─────────────────────────────────────────────────────────────────────────┐
│ THE REQUEST-RESPONSE CYCLE │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ YOU (Browser) KITCHEN (Server) │
│ ┌──────────┐ ┌──────────────┐ │
│ │ │ ──── "I'd like pasta" ────► │ │ │
│ │ :) │ (REQUEST) │ [chef] │ │
│ │ │ │ │ │
│ │ │ ◄──── Here you go! ──────── │ │ │
│ │ │ (RESPONSE) │ │ │
│ └──────────┘ └──────────────┘ │
│ │
│ The waiter (HTTP) is the protocol that makes this exchange work! │
│ │
└─────────────────────────────────────────────────────────────────────────┘使用ASCII艺术图可视化概念。制作带框和标签的图:
┌─────────────────────────────────────────────────────────────────────────┐
│ 请求-响应循环 │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ 你(浏览器) 厨房(服务器) │
│ ┌──────────┐ ┌──────────────┐ │
│ │ │ ──── "我想要一份意面" ────► │ │ │
│ │ :) │ (请求) │ [厨师] │ │
│ │ │ │ │ │
│ │ │ ◄──── 给你! ──────── │ │ │
│ │ │ (响应) │ │ │
│ └──────────┘ └──────────────┘ │
│ │
│ 服务员(HTTP)是让这个交互得以实现的协议! │
│ │
└─────────────────────────────────────────────────────────────────────────┘Mintlify Components Reference
Mintlify组件参考
| Component | When to Use |
|---|---|
| "What you'll learn" boxes, Key Takeaways |
| Common mistakes, gotchas, prerequisites |
| Pro tips, rules of thumb, best practices |
| Additional context, side notes |
| Expandable content, Q&A sections, optional deep-dives |
| Comparing different approaches side-by-side |
| Sequential processes, numbered workflows |
| Resource links (articles, videos, references) |
| Individual resource with icon and link |
| 组件 | 使用场景 |
|---|---|
| "你将学到什么"框、关键要点 |
| 常见错误、陷阱、前置知识 |
| 专业技巧、经验法则、最佳实践 |
| 附加上下文、旁注 |
| 可展开内容、问答章节、可选深度讲解 |
| 并排对比不同方法 |
| 顺序流程、编号工作流 |
| 资源链接(文章、视频、参考资料) |
| 带图标和链接的单个资源 |
Card Icons Reference
卡片图标参考
| Content Type | Icon |
|---|---|
| MDN/Official Docs | |
| Articles/Blog Posts | |
| Videos | |
| Courses | |
| Related Concepts | Context-appropriate ( |
| 内容类型 | 图标 |
|---|---|
| MDN/官方文档 | |
| 文章/博客 | |
| 视频 | |
| 课程 | |
| 相关概念 | 上下文相关图标( |
Quality Checklist
质量检查表
Before finalizing a concept page, verify ALL of these:
完成概念页面前,验证以下所有项:
Structure
结构
- Opens with engaging questions that hook the reader
- Shows a simple code example immediately after the opening
- Has "What you'll learn" Info box right after the opening
- Major sections are separated by horizontal rules
--- - Has a real-world analogy with ASCII art diagram
- Has a "Common Mistakes" or "The #1 Mistake" section
- Has a "Key Takeaways" section summarizing 8-10 points
- Has a "Test Your Knowledge" section with 5-6 Q&As
- Ends with Related Concepts, Reference, Articles, Videos in that order
- 开篇用吸引人的问题钩子读者
- 开篇后立即展示简单代码示例
- 开篇后紧跟"你将学到什么"Info框
- 主要章节用水平分隔线分隔
--- - 包含带ASCII艺术图的实际场景类比
- 包含"常见错误"或"最常见错误"章节
- 包含总结8-10个要点的"关键要点"章节
- 包含带5-6个问答的"测试你的知识"章节
- 按顺序以相关概念、参考资料、文章、视频结尾
Linking
链接
- All new Web APIs/methods have inline MDN links on first mention
- All related concepts link to their concept pages ()
/concepts/slug - Reference section has multiple MDN links
- 4-6 quality articles with descriptions
- 3-4 quality videos with descriptions
- 所有新Web API/方法首次提及都有内嵌MDN链接
- 所有相关概念都链接到对应概念页面()
/concepts/slug - 参考资料章节包含多个MDN链接
- 4-6篇带描述的高质量文章
- 3-4篇带描述的高质量视频
Code Examples
代码示例
- First code example is dead simple
- Uses step-by-step comments for complex examples
- Shows output in comments ()
// "result" - Uses ❌ and ✓ for wrong/correct patterns
- Uses meaningful variable names
- Progresses from simple to complex
- 第一个代码示例极其简单
- 复杂示例使用分步注释
- 注释中展示输出()
// "result" - 用❌和✓标记错误/正确模式
- 使用有意义的变量名
- 从简单到复杂逐步推进
Content Quality
内容质量
- Written for someone who might be new to coding
- Prerequisites are noted with Warning component
- No assumptions about prior knowledge without links
- Tables used for quick reference information
- ASCII diagrams for visual concepts
- 为可能的编程新手编写
- 前置知识在Warning组件中注明
- 不假设读者有前置知识,必要时添加链接
- 表格用于快速参考信息
- 可视化概念使用ASCII图
Language Quality
语言质量
- Description starts with "Learn" or "Understand" (not "Master")
- No overuse of em dashes (fewer than 15 outside Key Takeaways and structured sections)
- No AI superlatives: "dramatically", "fundamentally", "incredibly", "extremely"
- No stiff phrases: "one of the most important", "essential points", "It should be noted"
- Emphasis patterns vary (not all "Key insight:" or "Best practice:")
- Playful touches are sparse (1-2 per major section maximum)
- No filler words: "basically", "essentially", "actually", "very", "really"
- Sentences are direct (no "In order to", "Due to the fact that")
- 描述以"Learn"或"Understand"开头(避免"Master")
- 破折号使用不过度(关键要点和结构化章节外少于15个)
- 无AI式最高级:"dramatically", "fundamentally", "incredibly", "extremely"
- 无生硬短语:"one of the most important", "essential points", "It should be noted"
- 强调模式多样化(不重复使用"Key insight:"或"Best practice:")
- 趣味内容适度(每个主要章节最多1-2个)
- 无填充词:"basically", "essentially", "actually", "very", "really"
- 句子直接(无"In order to", "Due to the fact that")
Resource Quality
资源质量
- All article/video links are verified working
- All resources are JavaScript-focused (no C#, Python, Java resources)
- Each resource has a specific 2-sentence description (not generic)
- Resource descriptions explain what makes each unique
- No outdated resources (check dates for time-sensitive topics)
- 4-6 articles from reputable sources
- 3-4 videos from quality creators
- 所有文章/视频链接验证可用
- 所有资源聚焦JavaScript(无C#, Python, Java资源)
- 每个资源都有具体的2句话描述(非通用)
- 资源描述解释其独特之处
- 无过时资源(对时效性强的主题检查日期)
- 4-6篇来自权威来源的文章
- 3-4篇来自高质量创作者的视频
Writing Tests
编写测试
When adding code examples, create corresponding tests in :
/tests/javascript
// tests/{category}/{concept-name}/{concept-name}.test.js
import { describe, it, expect } from 'vitest'
describe('Concept Name', () => {
describe('Basic Examples', () => {
it('should demonstrate the core concept', () => {
// Convert console.log examples to expect assertions
expect(typeof "hello").toBe("string")
})
})
describe('Common Mistakes', () => {
it('should show the wrong behavior', () => {
// Test the "wrong" example to prove it's actually wrong
})
it('should show the correct behavior', () => {
// Test the "correct" example
})
})
})添加代码示例时,在目录下创建对应的测试:
/tests/javascript
// tests/{category}/{concept-name}/{concept-name}.test.js
import { describe, it, expect } from 'vitest'
describe('概念名称', () => {
describe('基础示例', () => {
it('应该演示核心概念', () => {
// 将console.log示例转换为expect断言
expect(typeof "hello").toBe("string")
})
})
describe('常见错误', () => {
it('应该展示错误行为', () => {
// 测试"错误"示例,证明其确实错误
})
it('应该展示正确行为', () => {
// 测试"正确"示例
})
})
})SEO Checklist
SEO检查表
Verify these elements before publishing any concept page:
发布任何概念页面前,验证以下元素:
Title & Meta Description
标题与元描述
- Title is 50-60 characters — check with character counter
- Title ends with "in JavaScript" — SEO keyword at end
- Title has a compelling hook — tells reader what they'll understand
- sidebarTitle matches title but without "in JavaScript" — cleaner navigation
- Description is 150-160 characters — don't leave value on the table
- Description includes primary keyword in first sentence
- Description includes 1-2 secondary keywords naturally
- Description starts with action word (Learn, Understand, Discover — avoid "Master")
- Description promises specific value — what will they learn?
- 标题长度为50-60字符 — 用字符计数器检查
- 标题以"in JavaScript"结尾 — SEO关键词放在末尾
- 标题有吸引人的钩子 — 告诉读者将理解什么
- sidebarTitle与标题匹配,但无"in JavaScript" — 导航更简洁
- 描述长度为150-160字符 — 不要浪费展示价值的机会
- 描述首句包含主关键词
- 描述自然融入1-2个次要关键词
- 描述以动作词开头(Learn, Understand, Discover — 避免"Master")
- 描述承诺具体价值 — 读者将学到什么?
Keyword Placement
关键词布局
- Primary keyword in title
- Primary keyword in description
- Primary keyword in first paragraph (within first 100 words)
- Primary keyword in at least one H2 heading
- Secondary keywords in H2/H3 headings where natural
- Keywords in "What you'll learn" box items
- No keyword stuffing — content reads naturally
- 标题包含主关键词
- 描述包含主关键词
- 第一段包含主关键词(前100词内)
- 至少一个H2标题包含主关键词
- H2/H3标题自然融入次要关键词
- "你将学到什么"框包含关键词
- 无关键词堆砌 — 内容读起来自然
Content Structure
内容结构
- Opens with question hook matching search intent
- Shows code example in first 200 words
- First paragraph after H2s directly answers the implied question
- Content is 1,500+ words (comprehensive coverage)
- Short paragraphs (2-4 sentences maximum)
- Uses bullet lists for 3+ related items
- Uses numbered lists for sequential processes
- Uses tables for comparisons and reference data
- Key terms bolded on first mention with MDN links
- 开篇用符合搜索意图的问题钩子
- 前200词内展示代码示例
- H2后的第一段直接回答隐含问题
- 内容长度1500+词(全面覆盖)
- 短段落(最多2-4句)
- 3项以上相关内容使用项目符号列表
- 顺序流程使用编号列表
- 对比和参考数据使用表格
- 关键术语首次提及加粗并添加MDN链接
Featured Snippet Optimization
特色摘要优化
- "What is X" section has 40-60 word definition paragraph
- "How to" sections use numbered steps or component
<Steps> - Comparison sections use tables with clear headers
- At least one H2 is phrased as a question matching search query
- "What is X"章节包含40-60词的定义段落
- "How to"章节使用编号步骤或组件
<Steps> - 对比章节使用带清晰表头的表格
- 至少一个H2是符合搜索查询的问题式标题
Internal Linking
内部链接
- Links to 3-5 related concept pages in body content
- Uses descriptive anchor text (not "click here" or "here")
- Prerequisites linked in Warning component at start
- Related Concepts section has 4 cards with relevant concepts
- Links appear in natural context — not forced
- 正文中链接到3-5个相关概念页面
- 使用描述性锚文本(非"click here"或"here")
- 前置知识在开篇的Warning组件中链接
- 相关概念章节包含4个相关概念卡片
- 链接出现在自然语境中 — 不生硬
Technical SEO
技术SEO
- Slug is lowercase with hyphens
- Slug contains primary keyword
- Slug is 3-5 words maximum
- All external links use proper URLs (no broken links)
- MDN links are current (check they resolve)
- Slug为小写并使用连字符
- Slug包含主关键词
- Slug最多3-5词
- 所有外部链接使用正确URL(无失效链接)
- MDN链接是最新的(检查是否可访问)