Link Guidelines for Docs-Angular

Complete guide for creating proper links in the docs-angular system

πŸ”— Link Guidelines for Docs-Angular

This guide provides comprehensive rules for creating proper links in the docs-angular system to ensure all navigation works correctly.

🎯 Core Principles

βœ… Prefer Absolute Paths (Recommended)

<!-- βœ… CORRECT: Absolute path from root -->
[Documentation Guide](/documentation/add-documentation)

<!-- βœ… ALSO CORRECT: Relative paths now supported -->
[Documentation Guide](../documentation/add-documentation)
[Documentation Guide](./add-documentation)

<!-- ❌ WRONG: File extensions -->
[Documentation Guide](./add-documentation.md)
[Documentation Guide](/documentation/add-documentation.md)

πŸ†• Relative Link Support (NEW)

The system now automatically converts relative links to absolute monorepo paths:

<!-- These relative links now work automatically -->
[GoGrab Space](../GoGrab-Space)                    β†’ /GoGrab-Space
[Theme System](../GoGrab-Space/theme-system)      β†’ /GoGrab-Space/theme-system
[Apps Overview](./apps)                            β†’ /apps (if in root context)

βœ… No File Extensions

<!-- βœ… CORRECT: No .md extension -->
[Theme System](/GoGrab-Space/theme-system)

<!-- ❌ WRONG: With .md extension -->
[Theme System](/GoGrab-Space/theme-system.md)

βœ… Follow Directory Structure

<!-- βœ… CORRECT: Matches actual file structure -->
[Enhanced Docs System](/documentation/docs-angular-system/enhanced-docs-system)

<!-- ❌ WRONG: Doesn't match structure -->
[Enhanced Docs System](/docs-angular-system/enhanced-docs-system)

πŸ“ Path Structure Rules

Public Documentation

Files under english/public/ β†’ Root path without /public/

File: english/public/documentation/add-documentation.md
Link: /documentation/add-documentation

Project Documentation

Files under english/ProjectName/ β†’ Include project name

File: english/GoGrab-Pulse/intro/artist-roster.md
Link: /GoGrab-Pulse/intro/artist-roster

Subsections

Files in nested directories β†’ Include full path

File: english/public/documentation/docs-angular-system/enhanced-docs-system.md
Link: /documentation/docs-angular-system/enhanced-docs-system

🌍 Language Support

English Links (Default)

[Getting Started](/getting-started)
[Documentation](/documentation)

Spanish Links

[Comenzar](/es/comenzar)
[DocumentaciΓ³n](/es/documentacion)

Cross-Language Linking

Use frontmatter for intelligent language switching:

---
crossLanguageId: example-page
languageVersions:
  en: documentation/example-page
  es: documentacion/pagina-ejemplo
---

πŸ”§ Common Link Patterns

Documentation System Links

<!-- Main documentation index -->
[Documentation](/documentation)

<!-- Specific guides -->
[Add Documentation](/documentation/add-documentation)
[Configuration Guide](/documentation/docs-configuration)
[Frontmatter System](/documentation/frontmatter-metadata-system)

<!-- System internals -->
[Enhanced Docs System](/documentation/docs-angular-system/enhanced-docs-system)
[Navigation System](/documentation/docs-angular-system/NAVIGATION-IMPROVEMENTS-COMPLETE)

Project Links

<!-- Project root -->
[GoGrab Pulse](/GoGrab-Pulse)

<!-- Project sections -->
[Artist Roster](/GoGrab-Pulse/intro/artist-roster)
[Theme System](/GoGrab-Space/theme-system)

App Links

<!-- App overview -->
[Applications](/apps)

<!-- Specific apps -->
[Singularity App](/apps/singularity)
[Editor Web](/apps/editor-web)
[Space Map](/apps/space-map)
[UX Test](/apps/ux-test)

🎯 Anchor Links (Fragments)

Section Headers

<!-- Link to specific section -->
[Multi-Language Support](/documentation/docs-angular-system/enhanced-docs-system#multi-language-support)

<!-- Headers are automatically converted to anchors -->
## Multi-Language Support  β†’ #multi-language-support
### Getting Started Guide   β†’ #getting-started-guide

Best Practices for Headers

<!-- βœ… GOOD: Simple, clean headers -->
## Widget Economy
## Development Roadmap
## Quick Start Guide

<!-- ❌ BAD: Complex headers with formatting -->
## 🧩 **WIDGET ECONOMY ARCHITECTURE**
## πŸ—ΊοΈ **THE DEVELOPMENT ROADMAP**

πŸ†• Relative Link Resolution (NEW FEATURE)

How It Works

The system automatically converts relative links to absolute monorepo paths:

<!-- From within /GoGrab-Space/libs-structural/ux-test-lib/ -->
[Directory:](../libs-structural)                    β†’ /GoGrab-Space/libs-structural
[Parent Project:](../../GoGrab-Space)              β†’ /GoGrab-Space
[Theme System:](../../GoGrab-Space/theme-system)   β†’ /GoGrab-Space/theme-system

Supported Patterns

Examples

<!-- In /GoGrab-Space/libs-structural/ux-test-lib/ux-test -->
[Back to Structural](../libs-structural)           β†’ /GoGrab-Space/libs-structural
[GoGrab Space Home](../../GoGrab-Space)            β†’ /GoGrab-Space
[Theme System](../../GoGrab-Space/theme-system)    β†’ /GoGrab-Space/theme-system

<!-- In /apps/singularity/ -->
[Apps Overview](../apps)                           β†’ /apps
[Editor Web](../editor-web)                        β†’ /apps/editor-web

🚨 Common Mistakes to Avoid

❌ File Extension Mistakes

<!-- DON'T USE THESE -->
[Guide](./guide.md)           <!-- Relative with extension -->
[Guide](../guide.md)          <!-- Parent directory with extension -->
[Guide](guide/index.md)       <!-- Subdirectory with extension -->
[Guide](/documentation/guide.md)
[Guide](/documentation/guide.html)

❌ Path Structure Mistakes

<!-- DON'T USE THESE -->
[Guide](/public/documentation/guide)     <!-- Including /public/ -->
[Guide](/english/documentation/guide)    <!-- Including /english/ -->
[Guide](/docs/guide)                     <!-- Wrong base path -->

πŸ” Testing Your Links

Manual Testing

  1. Start the docs-angular development server: nx serve docs-angular
  2. Navigate to your page
  3. Click each link to verify it works
  4. Check browser console for 404 errors

Link Validation Checklist

πŸ› οΈ Debugging Broken Links

404 Errors

If you get a 404 error:

  1. Check the file actually exists in the correct location
  2. Verify the path matches the manifest structure
  3. Ensure no typos in the path
  4. Run yarn docs:scan to update the manifest

Wrong Page Loading

If the wrong page loads:

  1. Check for duplicate file names
  2. Verify the full path is unique
  3. Check for conflicting routes

Console Debugging

Look for these console messages:

🧭 Navigating to: /documentation/guide
βœ… Navigation successful: /documentation/guide
❌ Nav failed: /documentation/wrong-path

πŸ“‹ Quick Reference

Template for New Links

<!-- Internal documentation -->
[Page Title](/section/page-name)

<!-- Project documentation -->
[Page Title](/ProjectName/section/page-name)

<!-- With anchor -->
[Section Title](/section/page-name#section-anchor)

<!-- Cross-language (use frontmatter) -->
crossLanguageId: unique-page-id
languageVersions:
  en: section/page-name
  es: seccion/nombre-pagina

Common Paths

<!-- Documentation -->
/documentation                           <!-- Main docs index -->
/documentation/add-documentation         <!-- How to add docs -->
/documentation/docs-configuration        <!-- Configuration guide -->
/documentation/docs-angular-system/      <!-- System internals -->

<!-- Apps -->
/apps                                    <!-- Apps overview -->
/apps/singularity                        <!-- Singularity app -->
/apps/editor-web                         <!-- Editor Web app -->

<!-- Projects -->
/GoGrab-Pulse                           <!-- GoGrab Pulse project -->
/GoGrab-Space                           <!-- GoGrab Space project -->

<!-- Core pages -->
/getting-started                         <!-- Getting started -->
/troubleshooting                         <!-- Troubleshooting -->

πŸŽ‰ Best Practices Summary

  1. Always use absolute paths starting with /
  2. Never include file extensions (.md, .html)
  3. Follow the actual directory structure from the manifest
  4. Test all links before committing
  5. Use frontmatter for cross-language linking
  6. Keep headers simple for reliable anchor links
  7. Update links when moving or renaming files

Following these guidelines ensures all links work correctly and provides a seamless navigation experience for users of the docs-angular system.


Need help? Check the Documentation Configuration guide or review the Enhanced Documentation System for more details.