Working with Images
Images enhance documentation by providing visual context, examples, and breaking up text-heavy content. Hereβs how to use them effectively in CelestialDocs.
Image Storage Locations
Content Collection Assets (Recommended)
Store images alongside your documentation in content/docs/assets/:
content/
βββ docs/
βββ assets/
β βββ getting-started.jpg
β βββ configuration-overview.jpg
β βββ navigation-hierarchy.jpg
βββ getting-started/
β βββ setup.mdx
βββ configuration/
βββ basics/
βββ overview.mdx
Benefits:
- Images live with documentation content
- Easy to version control together
- Better organization for multiple collections
- Clear scope and ownership
Public Folder (Site-wide Assets)
Use public/ for assets shared across all collections:
public/
βββ logo.svg
βββ favicon.ico
βββ shared-diagram.png
Use cases:
- Logo and branding assets
- Favicons and meta images
- Shared diagrams used in multiple collections
Using Images in Markdown
Basic Syntax

Relative Paths from Content
Images in the same collection use relative paths:
<!-- From content/docs/getting-started/setup.mdx -->

<!-- From content/docs/configuration/basics/overview.mdx -->

Example with Images

The image above demonstrates configuration concepts visually.
Image Best Practices
1. Descriptive Alt Text
Always provide meaningful alt text for accessibility:
<!-- β Bad -->

<!-- β
Good -->

2. Optimize File Sizes
- Hero images: 1200x630px, ~100KB max
- Content images: 800x400px, ~50KB max
- Screenshots: Actual size, compressed
- Format: WebP (best), JPEG (good), PNG (when transparency needed)
3. Naming Conventions
Use descriptive, kebab-case names:
β
navigation-hierarchy-diagram.jpg
β
getting-started-hero.jpg
β
config-example-screenshot.png
β img1.jpg
β Screen Shot 2024-01-01.png
β MyImage.JPG
4. Image Dimensions
Consistent sizing creates better visual flow:
<!-- Hero images at top of pages -->

<!-- Inline content images -->

<!-- Small icons or badges -->

Advanced Techniques
Captioned Images
Add context with text below images:

_Figure 1: CelestialDocs navigation architecture showing the three-tier hierarchy_
Example:

Figure: Modern development environment with proper tooling
Linking Images
Make images clickable:
[](/docs/configuration/basics/overview)
Image in Lists
1. **Setup your environment**

Install Node.js and clone the repository.
2. **Configure settings**

Update data/config.ts with your preferences.
Organization Tips
Group by Section
content/docs/assets/
βββ getting-started/
β βββ installation-step-1.jpg
β βββ installation-step-2.jpg
βββ configuration/
β βββ basic-setup.jpg
β βββ advanced-options.jpg
βββ shared/
βββ logo.svg
Version Images with Docs
When updating documentation, update related images in the same commit:
git add content/docs/getting-started/setup.mdx
git add content/docs/assets/getting-started.jpg
git commit -m "Update setup guide and screenshot"
Use .gitattributes for LFS
For large images, consider Git LFS:
*.jpg filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.webp filter=lfs diff=lfs merge=lfs -text
Troubleshooting
Image Not Showing
- Check the relative path is correct
- Verify file exists in the assets folder
- Check file extension matches (case-sensitive)
- Ensure image is committed to repository
Path Examples by Location
<!-- From: content/docs/introduction.mdx -->

<!-- From: content/docs/getting-started/setup.mdx -->

<!-- From: content/docs/configuration/basics/overview.mdx -->

<!-- From: content/docs/navigation-system/core-concepts/entries.mdx -->

Build Errors
If images cause build errors:
- Ensure filenames have no spaces
- Use only alphanumeric, hyphens, and underscores
- Check file permissions are correct
- Verify image files arenβt corrupted
Summary
- β
Store images in
content/docs/assets/for better organization - β Use descriptive alt text for accessibility
- β Optimize images before adding (WebP or compressed JPEG)
- β Use relative paths from your markdown files
- β Follow consistent naming conventions
- β Keep image sizes appropriate (1200x630 for heroes, 800x400 for content)
Next Steps
- Learn about MDX components for advanced image handling
- Explore Markdown basics for other syntax
- Review Frontmatter options for page configuration