Skip to main content
NostalgiaPHP
Home
About
  • Components
  • Blink
  • Fetch
  • Slider
  • REST API
BlogDoxSearchContact
Admin
  • Sitemap
  • Robots
GitHub
  1. Home
  2. Dox
  3. Compatibility Contract
Sep 11, 2025

Compatibility Contract

Directory Structure

  • content/pages/{slug}.md → /slug (or / for index.md)
  • content/collections/{name}/{slug}.md → /{name}/{slug}
  • static/ served at /static/...
  • Front-matter keys (optional, don’t break if missing)
  • Defaults (no surprises)
  • If a key is missing, site still renders (infer title/desc or leave blank)
  • Templates/partials API
  • Templates receive: $title, $content, $meta, $path
  • Partials inherit variables from callers; avoid renaming expected vars

Upgrade Strategy (how to evolve code without breaking sites)

  • No content migrations. Never require users to rename folders or files.
  • Additive front-matter only. New keys are optional; old keys keep working.
  • Graceful fallbacks. If a new feature is disabled/missing, render as before.
  • Feature flags in config.php. (e.g., 'features' => ['sitemap_indexes' => true])
  • Semantic-ish versioning. Bump a version constant when behavior changes.

Files you can swap safely

  • functions.php — new helpers, parsers, fallbacks. Keep function names/returns stable.
  • index.php — routing. Don’t change URL shapes; add new routes behind flags.
  • config.php — user merges. Provide defaults in functions.php so omissions don’t break.

Explore

Recent Items

  • You Might Not Want to Use NostalgiaPHP
    Oct 8, 2025
  • Understanding the Styles
    Oct 5, 2025
  • Appear Animations
    Oct 2, 2025
  • Nosty CLI — Your New Best Friend
    Sep 28, 2025
  • Introducing the NostalgiaPHP REST API
    Sep 27, 2025

Tags

  • animation (1)
  • api (1)
  • blink (1)
  • css (1)
  • intersectionobserver (1)
  • js (1)
  • json (1)
  • nostalgia (2)
  • php (3)
  • reactivity (1)
  • rest (1)
  • retro (3)
  • simplicity (3)
  • slank (1)
© 2025 NostalgiaPHP. All rights reserved. ⬆ Back to Top