mrvautin / squido

A dead simple static HTML website builder which can be hosted anywhere for super fast websites and very little effort
https://squido.markmoffat.com/
MIT License
64 stars 6 forks source link

Sitemap appends trailing slash #9

Closed bmlyon closed 2 years ago

bmlyon commented 2 years ago

The sitemap appears to append a trailing slash at the end of my post URLs. I assume this is because my permalink values include the trailing slashes but Squido assumed they wouldn't. Is there a config option or some other way to change this behavior?

mrvautin commented 2 years ago

This is by design. I'm no SEO expert, is there a reason you'd not want a trailing slash?

bmlyon commented 2 years ago

This is by design. I'm no SEO expert, is there a reason you'd not want a trailing slash?

I want one trailing slash, I don't want two. Right now my URLs in the sitemap are like https://tld.com/content/something/apple//

mrvautin commented 2 years ago

Oh I see. That shouldn't be happening. Yes that would be because of your meta permalink. I could possibly add some detection to remove the slash if it exists.

Is it possible to remove the slash from your permalink meta value?

bmlyon commented 2 years ago

If I remove it from the permalink value then I would have to append the trailing slash in templates, partials, and other code. Overall that's not a big deal but IMO ideally the content could control the structure rather than the code. It's a consistency habit I have.

Templates and partials: {{post.permalink}} vs {{post.permalink}}/

mrvautin commented 2 years ago

Ok. Yeah that's a good reason.

Let me look at adding some code to detect the trailing permalink slash and remove/don't add one.

bmlyon commented 2 years ago

Thank you, I appreciate it. I'm not in a hurry and this is currently for a personal project with no time frame :)

mrvautin commented 2 years ago

@bmlyon I've had a go at fixing from what I understand your issue is. Could you have a look at ab35931d48fdbbecaee5685cf1c41937d080611f and let me know if it fixes your issue?

bmlyon commented 2 years ago

@bmlyon I've had a go at fixing from what I understand your issue is. Could you have a look at ab35931 and let me know if it fixes your issue?

@mrvautin thank you that fix appears to function as expected 👍