[Localdev] Update routes.yaml dynamically

Hi! This question is scoped to local development.

Goal

I want to avoid needing to manually re-upload routes.yaml via the admin every time I update it. Is this possible?

My setup

I have two local repos:

  • Ghost site install (ghost-site)
  • Custom theme repo (custom-theme)

I track routes.yaml in the custom-theme repo, but for it to take effect, it needs to be present in one or both (???) of:

  • ghost-site/current/content/settings/routes.yaml
  • ghost-site/content/settings/routes.yaml

What I’ve tried

I tried symlinking from custom-theme to ghost-site:

ln -s ~/dev/custom-theme/routes.yaml \
      ~/dev/ghost-site/current/content/settings/routes.yaml

Creating the symlink had no effect, even after using ghost-cli to restart the local dev server.

Questions

  1. Does the manual upload process trigger a db write of some kind that’s necessary for Ghost to pick up the routes.yaml changes?
  2. Slightly tangential: is there somewhere where I can read more about the role the /current dir plays in Ghost installs? It hasn’t really clicked for me when I should be updating /current vs the non-current paths.