amyjko / faculty

Amy's faculty webpage
Creative Commons Zero v1.0 Universal
22 stars 21 forks source link

Section anchor links have duplicated URL base paths #164

Closed kevinlin1 closed 1 year ago

kevinlin1 commented 1 year ago

If you visit the CER page, all the anchor links beside each section heading have a duplicated base URL. For example, next to "What is computing education research?" the link goes to a 404 page:

/ajko/ajko/cer#what-is-cer

I expected the generated anchor link to instead read:

/ajko/cer#what-is-cer

I think the problem is caused by this line of code in the Linkable component where $page.url.pathname is prepended to the anchor link.

https://github.com/amyjko/faculty/blob/2497a50dcabdf4617cc476ce207fb8cc5f4141dc/src/lib/components/Linkable.svelte#L27

This Link component that it uses also prepends the $base path, thus duplicating the /ajko part of the $base path.

https://github.com/amyjko/faculty/blob/2497a50dcabdf4617cc476ce207fb8cc5f4141dc/src/lib/components/Link.svelte#L16

amyjko commented 1 year ago

Thanks for the report and the sleuthing! Base paths have caused nothing but headaches, sigh.