Markdown 速查表

提示區塊

example - 程式碼範例

💻設定範例
---
title: 我的部落格文章
date: 2025-01-15
category: Development
tags: [Git, DevOps]
excerpt: "文章內容的簡潔描述..."
---

區塊內的進階格式

提示區塊內的程式碼區塊

💡Git 設定

設定你的 Git 身份:

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

提示區塊內的表格

💡連接埠範圍
作業系統範圍數量
Linux32768-6099928232
Windows49152-6553516384
macOS49152-6553516384

巢狀格式

常見陷阱

避免這些錯誤:

  1. 硬編碼路徑
// ❌ 不好
const path = 'C:\\Users\\neo\\file.txt';
// ✅ 好
const path = require('path').join(__dirname, 'file.txt');
  1. 缺少錯誤處理
    • 總是使用 try-catch 區塊
    • 驗證使用者輸入
    • 正確記錄錯誤
  2. 忽略 async/await

    回呼函式會導致「回呼地獄」。使用現代非同步模式。