-
|
I have nav bar with menu links (all relative links) at the top. Some of the links point to pages in subfolders. Whenever, I click the menu items that point to pages in subfolders, the targets of all menu links are broken. Anyway to tell Unpoly to update the links of menu items if I ascend or descend folders? |
Beta Was this translation helpful? Give feedback.
-
|
Shouldn't the menu links be absolute in this case? If you cannot render absolute URLs into your HTML for some reason, you could also try absolutizing the URLs when they are first rendered: up.compiler('.menu a[href]', function(link) {
link.href = up.util.normalizeURL(link.href)
}) |
Beta Was this translation helpful? Give feedback.
-
|
I was going to change href attribute manually to include or remove /../ in the path. But your method is better, I will try that. Thank you |
Beta Was this translation helpful? Give feedback.
Shouldn't the menu links be absolute in this case?
If you cannot render absolute URLs into your HTML for some reason, you could also try absolutizing the URLs when they are first rendered: