Log in Sign up

Using the filename as a slug?

Hi there, I understand that I can set the "slug" metadata to change the slug to something other than a slugified version of a post's title.

Is there a way to just default to using the filename?

For example, if the filename is 2015-04-05.pithy-slug.md

And the title is # How to write pithy slugs in 17 steps or more!

I would like the slug to be pithy-slug.

Alex


20 hours ago, 5 replies   link-format   filename   Edit question

Yes, this is possible without using metadata.

Open up the dashboard for your site and go to the Link format settings page. Select Custom format and in the text field enter {{name-without-extension}}.

There is a guide to using custom link formats. Please let me know if you have any questions about this or anything else

Answered 5 days ago · Edit answer

I did look there, but for some reason I didn't see that. Thank you for helping as always! :)

Alex

Answered 2 days ago · Edit answer

Ah, I remember now what the issue was. The filenames include the date so {{name-without-extension}} returns 2015-04-05.pithy-slug and not pithy-slug. I guess metadata is the way to go here?

Alex

Answered 2 days ago · Edit answer

I can think about adding a {{name-without-extension-and-date-tokens}}! For now, I recommend using custom slug metadata if you're not happy with the one generated by Blot from the title, e.g.

Slug: pithy-slug
Answered a day ago · Edit answer

Okay, I'll use metadata for now. If you do add this variable, do send me an email please (you already have it from the iCloud conversation).

Alex

Answered 20 hours ago · Edit answer

Newsletter
Get updates on Blot’s latest features and changes. Delivered every three months.