Simpler Slugs đ
This is one of those features that I hope most people wonât notice.
A slug in the web world isnât a slimy, plant-destroying mollusc, itâs the end part of the URL to a blog post, usually based on the title of the post. If I create a blog post with a title âHello, World đâ, then the slug for that post should be â/hello-worldâ.Â
In Pagecord, for various reasons, the slug is calculated on the fly. It uses the post title, but it also appends a unique identifier. So for the above example in Pagecord, the slug would be â/hello-world-0af7e629â. If you subsequently changed the title to âwassup?!â, the slug would be â/wassup-0af7e629â.Â
Iâve decided to change how this works đŹ
The existing method is actually quite neat because it simplifies things (no need to store a slug), but there are a couple of downsides that myself and others would like to see fixed.Â
Firstly, many other blogs platforms such as static sites, Wordpress and Ghost donât append a unique identifier to the end of slugs. This looks a bit nicer, but the big advantage is that if people want to migrate their existing posts from one platform to another, simple slugs makes it easier because you can retain the same URL. Not so with these unique identifiers.
Secondly, some people might want to customise a post's slug. This isnât super common, admittedly, but itâs a nice feature to have.
From today, when you create a new post with a title in Pagecord, it will have a slug free of the unique identifier! Titleless posts still use the token as the slug, and all existing posts remain unaffected. A crucial point of note â when you change the title of a post, the slug will automatically change too, just like it always has.
Thereâs also a new Edit Slug option in the drop down menu on the edit post page, so if youâd like to remove the unique identifier from any of your existing posts, go nuts! Bear in mind that if you set a custom slug and then subsequently edit the title of the post, you'll need to set the custom slug once again because it will have been automatically changed. This is a tradeoff, but one that makes sense to me.
As I mentioned at the beginning, I hope most people wonât care or even notice this change. Pagecord remains completely effortless to use and will âjust workâ. The customisation option is there for people who need it, but it's hidden out of sight for everyone else.
p.s. đ is actually a snail, I know, sorry - but I like it đ