Strip trailing slash from the blog URL #6

Merged
gvrooyen merged 1 commit from trunk into trunk 2024-04-28 17:47:03 +00:00
gvrooyen commented 2024-04-28 17:30:06 +00:00 (Migrated from gitlab.com)

If blog_url has a trailing slash in the arguments to defaults.default_config(), uri_parse will set path to "/", which leads to root in the path configuration also becoming "/". In the sample configuration blog_url is "https://my.blog.example/". This leads to hrefs in the output that look like the following:

<link href="//css/normalize.css" rel="stylesheet">

which do not resolve correctly in the browser. The suggested solution is to strip a trailing slash from the blog URL, if present.

If `blog_url` has a trailing slash in the arguments to `defaults.default_config()`, `uri_parse` will set `path` to `"/"`, which leads to `root` in the path configuration also becoming `"/"`. In the sample configuration `blog_url` is `"https://my.blog.example/"`. This leads to `href`s in the output that look like the following: `<link href="//css/normalize.css" rel="stylesheet">` which do not resolve correctly in the browser. The suggested solution is to strip a trailing slash from the blog URL, if present.
Nicd commented 2024-04-28 17:46:58 +00:00 (Migrated from gitlab.com)

Thanks! 💜

Thanks! :purple_heart:
Nicd commented 2024-04-28 17:47:03 +00:00 (Migrated from gitlab.com)

mentioned in commit 32cba3db6e

mentioned in commit 32cba3db6eff96cac93db52e0f41c580e074b8b8
Nicd (Migrated from gitlab.com) merged commit 32cba3db6e into trunk 2024-04-28 17:47:03 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: nicd/scriptorium#6
No description provided.