Preserving Publish Date in URL / Dated Permalink Ghost 2.0

I can’t say for sure, but I remember Ghost 1.x having a simple way to toggle dates in URL, like https://domain.com/2018/10/11/post-title-here. Instead, by default in 2.0, it’d be https://domain.com/post-title-here

Since I migrated (exported then imported content) to Ghost 2.0, I noticed an immediate drop in hits, and that my URL’s no longer have the date preceding the title of the post.

One must download the Routes YAML file, update it, and send it back. It’s at the very bottom of this URL, adapted for your domain: https://youdomain.com/ghost/#/settings/labs

Here was the default YAML for my Blog:

routes:

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

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

Here it is after changing the permalink line permalink: /{slug}/ to permalink: /{year}/{month}/{day}/{slug}/:

routes:

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

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

References

This is a preview of Clap Button, a new feedback and analytics tools for Hydejack, built by yours truly. You can try it out on localhost for free, but it will be removed (together with this message) when building with JEKYLL_ENV=production. To use Clap Button on your site, get a subscription
and set clap_button: true in your config file.


© 2021. All rights reserved.