justin.deal/config/README.md
Justin Deal a80b2a5e01
All checks were successful
Build and Deploy / build (push) Successful in 40s
Make configs json and have light/dark images for socials
2025-05-04 16:59:10 -07:00

1.7 KiB

Site Configuration

This directory contains configuration files for the website. Instead of hardcoding values in the TypeScript files, these JSON files are used to make the site more configurable.

Available Configuration Files

  • site.json: Contains global site metadata, menu structure, and text strings
  • services.json: Contains homelab services organized by category
  • socials.json: Contains social media profile configurations (the single source of truth for all social profiles)

How to Use

To modify any configuration values, simply edit the appropriate JSON file. The changes will be reflected in the application without having to modify any TypeScript code.

Example: Updating Menu Items

To add or remove a menu item, edit the menu section in site.json:

"menu": {
  "home": "/",
  "about": "/about",
  "blog": "/blog",
  "projects": "/projects",
  "homelab": "/homelab",
  "code": "https://code.justin.deal",
  "new-page": "/new-page"
}

Example: Adding a New Service

To add a new service, find the appropriate category in services.json and add a new item:

"Media": [
  {
    "name": "Jellyfin",
    "link": "https://watch.justin.deal",
    "icon": "https://cdn.jsdelivr.net/gh/selfhst/icons/svg/jellyfin.svg",
    "alt": "Jellyfin",
    "tags": []
  },
  {
    "name": "Plex",
    "link": "https://plex.justin.deal",
    "icon": "https://cdn.jsdelivr.net/gh/selfhst/icons/svg/plex.svg",
    "alt": "Plex Media Server",
    "tags": ["media", "streaming"]
  }
]

Technical Implementation

The configuration files are loaded from this directory using the loadConfig function in src/lib/config.ts. The function reads the JSON files, parses them, and caches the results to avoid reading the files multiple times.