Broken links after changing theme (Caspar --> Lyra)

Hello,

I recently switched to Lyra in order to try out the theme and uploaded the custom routes (see below) as directed in the installation guide. I’m now finding that links I’d made to posts previously, where the date was in the post, are no longer working. For example, Reflections on working from home no longer works but https://blog.jonsdocs.org.uk/reflections-on-working-from-home/ does. I’m wondering if I forgot to merge the old routes file with the Lyra one or something. Switching back to Caspar doesn’t fix the issue.

The current routes.yaml says:

routes:
  /signup/: members/signup
  /signin/: members/signin
  /account/: members/account

collections:
  /:
    permalink: /{slug}/
    template: index

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

I’m keen to not need to replace all of my links, so any advice would be appreciated. Doesn’t look like I downloaded the original routes.yaml :cry:.

  • What’s your URL? https://blog.jonsdocs.org.uk
  • Locally hosted
  • What version of Ghost are you using? 3.27.0
  • node --version : v12.16.2
  • npm --version : v6.14.5

Many thanks in advance!

Try modifying the / collection’s permalink to /{year}/{month}/{day}/{slug}/ (it’s currently /{slug}/)

1 Like

That’s brilliant, thanks @vikaspotluri123. Fixed it.

Is there a way of having both link types work?

For those finding this thread, updated code is:

routes:
  /signup/: members/signup
  /signin/: members/signin
  /account/: members/account

collections:
  /:
    permalink: /{year}/{month}/{day}/{slug}/
    template: index

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

Yep, you should be able to use channels for that. However, my suggestion is to use redirects.