# Quiet — optional routing.
#
# The articles archive and the homepage are fully correct WITHOUT this file:
# Ghost renders home.hbs for page 1 of the root collection and index.hbs from
# /page/2/ onward. Uploading it in Ghost Admin → Settings → Labs → Routes adds
# two things:
#
#   • a real first page for the archive at /articles/, instead of the archive
#     starting at /page/2/ with no page 1;
#   • the podcast at /podcast/ and the video channel at /videos/. This file is
#     the ONLY way podcast.hbs and videos.hbs are ever reached: both templates
#     are deliberately absent from the editor's Template dropdown, because they
#     need the `posts` and `pagination` a plain page render does not have.
#
# ⚠ CREATE THE PAGES FIRST. Each data binding below reads a published Ghost
#   page, and a data-bound route whose page does not exist yet responds 404 —
#   including that section's RSS feed. Before uploading this file, publish
#   THREE pages with these exact slugs: `articles`, `podcast`, `videos`.
#   (Their titles are yours to choose; only the slug matters. No page slugged
#   `home` is needed: `/` below is a plain template route, and the homepage
#   composes itself from #home-* section pages instead.)
#
# The collections' data blocks are deliberately long-form, NAMED `page`, and
# `redirect: false` — all three parts are load-bearing:
#
#   • The key `page` is what Ghost's meta layer reads: the route inherits the
#     page's title, description and og/twitter/schema data, so /podcast/ is
#     titled after the show instead of "Site title (Page 1)". A data block
#     under any other name renders the same fields but silently loses all of
#     that metadata. Templates read the page as {{page.title}} etc.
#   • `redirect: false` because these pages' slugs equal their route paths,
#     so the redirect buys nothing when the page exists — and when it is
#     MISSING, a claiming route turns the pages router's fall-through into a
#     301 back onto itself: an infinite redirect loop instead of a 404.
#     (The shortform `data: page.podcast` forces redirect ON, which is why
#     it is not used here despite being the documented idiom.)
#   • `/: home` is a TEMPLATE route (a bare string names a template, per
#     route-settings-parser.ts): no data binding, no page to 404 on, so the
#     site root can never break. The homepage's content comes from the
#     #home-* section pages home.hbs fetches itself.

routes:
  /: home

collections:
  # ⚠ /articles/ MUST stay first. With no collection mounted on "/", Ghost
  #   advertises the FIRST collection's feed as the site's RSS feed in <head>,
  #   and on a writer's site that has to be the essays feed, not a section's.
  #
  # ⚠ The three filters below are a PARTITION, and that is not decoration. A
  #   post can belong to only ONE collection: Ghost loads a post claimed by
  #   another collection, then discards it again before rendering, which leaves
  #   holes in pagination. So the NOT-IN list here must always be exactly the
  #   union of the positive filters below it, and a fourth section means
  #   extending it again.
  #
  # ⚠ Do not tag one post both #podcast and #video. /articles/ excludes it and
  #   /podcast/ claims it, because /podcast/ is registered first.
  /articles/:
    permalink: /{slug}/
    filter: 'tag:-[hash-podcast,hash-video]'
    template: index
    data:
      page:
        resource: pages
        type: read
        slug: articles
        redirect: false

  # The podcast. Episodes are ordinary posts carrying the internal tag
  # #podcast. The show's own identity — cover art, name, description, the
  # player embed, and the route's own metadata — comes from the page slugged
  # "podcast", read in the template as {{page.*}}.
  #
  # ⚠ Tagging an already-published post #podcast moves it from /its-slug/ to
  #   /podcast/its-slug/, and Ghost writes no redirect for that. Migrating an
  #   existing show means adding the old paths to redirects.json.
  # rss: false — Ghost would otherwise mount /podcast/rss/, a feed with no
  # <enclosure> elements, which is exactly the feed the comment below warns
  # would mislead podcast apps. The show's real feed lives with its host
  # (Spotify/Transistor/etc.), linked through the platform-links row.
  /podcast/:
    permalink: /podcast/{slug}/
    filter: 'tag:hash-podcast'
    template: podcast
    rss: false
    data:
      page:
        resource: pages
        type: read
        slug: podcast
        redirect: false

  # The video channel. Films are ordinary posts carrying the internal tag
  # #video. The channel's own identity — name, description, any extra body
  # copy, and the route's own metadata — comes from the page slugged "videos",
  # read in the template as {{page.*}}.
  #
  # RSS stays enabled here, unlike the podcast's (rss: false above): a
  # blog-style feed of a film's show notes is a legitimate feed, whereas a
  # podcast feed with no <enclosure> would mislead podcast apps.
  #
  # ⚠ Tagging an already-published post #video moves it from /its-slug/ to
  #   /videos/its-slug/, and Ghost writes no redirect for that. Migrating an
  #   existing channel means adding the old paths to redirects.json.
  /videos/:
    permalink: /videos/{slug}/
    filter: 'tag:hash-video'
    template: videos
    data:
      page:
        resource: pages
        type: read
        slug: videos
        redirect: false

taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/
