This commit is contained in:
rizky 2024-07-24 01:15:26 -07:00
parent acf29ce20e
commit c0d2965c85
2 changed files with 6 additions and 2 deletions

View File

@ -101,9 +101,9 @@ export const breadcrumbPrefix = (md: MDLocal) => {
const lnk = link_hashes ? `#lnk=${link_hashes}` : ``; const lnk = link_hashes ? `#lnk=${link_hashes}` : ``;
if (p.md) { if (p.md) {
url = `${link.url}#${p.md.name}=${p.md.value}${lnk}`; url = `${p.url || link.url}#${p.md.name}=${p.md.value}${lnk}`;
} else { } else {
url = `${link.url}${lnk}`; url = `${p.url || link.url}${lnk}`;
} }
if (url) { if (url) {

View File

@ -72,6 +72,10 @@ export const Layout: FC<LYTChild> = (props) => {
if (!w.prasi_menu && !isEditor) { if (!w.prasi_menu && !isEditor) {
w.prasi_menu = { nav_override: true, nav: w.navigate, pm: null }; w.prasi_menu = { nav_override: true, nav: w.navigate, pm: null };
w.navigate = (async (_href, params) => { w.navigate = (async (_href, params) => {
if (!_href) {
console.error("Failed to navigate, empty url");
return;
}
if (_href.startsWith("/")) { if (_href.startsWith("/")) {
const url = new URL(location.href); const url = new URL(location.href);
const newurl = new URL(`${url.protocol}//${url.host}${_href}`); const newurl = new URL(`${url.protocol}//${url.host}${_href}`);