BlazorStatic icon indicating copy to clipboard operation
BlazorStatic copied to clipboard

Customize slug?

Open kijanawoodard opened this issue 1 year ago • 2 comments

I renamed my markdown files to have the publish date at the front to make it a bit easier sift the posts. however, now the urls have that date in them.

I had thought that the title from front matter was "slugified" but I see now it's the filename.

I don't see anything in options, but I'm looking for a way to customize the name of the html file. Did I miss it? In my particular case, I'd prefer to slug the title and let the filename be independent.

kijanawoodard avatar Feb 17 '25 21:02 kijanawoodard

I see. I was planning to implement the date retrieval functionality from post filename. As it would perfectly serve the dry principle (not having date in front matter and in filename). This is related, because the urls with dates really look ugly.

Currently it's not possible to change the urls of the posts from the filename to something else.

Here is the place in code where the thing is happening. https://github.com/BlazorStatic/BlazorStatic/blob/9a70e33f0d8b269ffcb34c68e8197baf1149c90e/src/Services/BlazorStaticContentService.cs#L56

I am thinking about implementing a Func that would take the file and probably something else and would return the url. wdyt?

tesar-tech avatar Feb 18 '25 10:02 tesar-tech

Hmm. I see the dilemma.

For seo, I kinda think it would make sense to make the sluggify the Title of the post. Otherwise, you have to make sure you name the file the same as the title to get the same effect.

https://moz.com/community/q/post/310059

kijanawoodard avatar Feb 24 '25 18:02 kijanawoodard