Skip to content

Commit

Permalink
More robust fix for prior bug. Don't want to match prefix or /post ma…
Browse files Browse the repository at this point in the history
…tches /post2
scosman committed Jan 17, 2024
1 parent 8ec0dd8 commit 541e867
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/routes/(marketing)/blog/(posts)/+layout.svelte
Original file line number Diff line number Diff line change
@@ -3,7 +3,10 @@
import { postList } from "./../posts.json"
let currentPost = null
for (const post of postList) {
if ($page.url.pathname.startsWith(post.link)) {
if (
$page.url.pathname == post.link ||
$page.url.pathname == post.link + "/"
) {
currentPost = post
continue
}

0 comments on commit 541e867

Please sign in to comment.