Slug
المعرّف النصي (Slug)
Definition
A URL-friendly string derived from a title, using lowercase letters and hyphens instead of spaces and special characters.
سلسلة صديقة لعناوين URL مشتقة من عنوان، تستخدم أحرفًا صغيرة وشرطات بدلاً من المسافات والأحرف الخاصة.
Why It Matters
Every glossary term in 404Fault has a slug that is both its Firestore document ID and its URL path. The slug 'firebase-authentication' is what appears in /glossary/firebase-authentication and what the KG API looks up.
كل مصطلح قاموس في 404Fault له slug يكون في آنٍ معًا ID مستند Firestore ومسار URL. slug 'firebase-authentication' هو ما يظهر في /glossary/firebase-authentication وما يبحث عنه KG API.
Full Definition
Example Usage
“function buildSlug(name: string): string { return name.toLowerCase().trim().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, ''); }”
“function buildSlug(name: string): string { return name.toLowerCase().trim().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, ''); }”
AI Builder Tips
Avoid these mistakes when using Slug:
Changing a slug after it's published — breaks existing URLs and search engine ranking
Not normalizing aliases to the canonical slug — causes duplicate content issues
Sign in to unlock guided AI explanations from AI Teacher.
Generate a Prompt
Copy this prompt and use it directly with any AI model — no setup needed.
Help me build a project using Slug. Explain: 1. What is Slug and why it matters 2. The core architecture and required tools 3. Step-by-step implementation plan 4. Common mistakes to avoid: Changing a slug after it's published — breaks existing URLs and search engine ranking, Not normalizing aliases to the canonical slug — causes duplicate content issues 5. Best practices and production tips