feat/seo #10

Merged
GauthierWebDev merged 10 commits from feat/seo into main 2025-04-18 16:44:38 +00:00
3 changed files with 3 additions and 5 deletions
Showing only changes of commit 668f730692 - Show all commits

View File

@ -133,7 +133,7 @@ export function doesLinkSubitemExist(link: NavigationLink, subitemHref: string):
return link.subitems.some((subitem) => subitem.href === subitemHref);
}
export function findNavigationLink(namespace: string, href: string): NavigationLink | undefined {
export function findNavigationLink(namespace: string, href?: string): NavigationLink | undefined {
const currentUrl = `/${namespace}/${href}`.replace(/\/+/g, "/").replace(/\/$/, "");
const foundLink = navigation

View File

@ -4,7 +4,7 @@ const routeRegex = /^\/docs\/(.*)$/;
export function route(pageContext: PageContext) {
if (pageContext.urlPathname === "/docs") {
return { routeParams: { key: "documentations" } };
return { routeParams: { key: "index" } };
}
const match = pageContext.urlPathname.match(routeRegex);

View File

@ -152,14 +152,12 @@ class DocsService {
};
}
public async getDoc(namespace: "root"): Promise<DocData | undefined>;
public async getDoc(namespace: "docs" | "certifications", key: string): Promise<DocData | undefined>;
public async getDoc(namespace: "root" | "docs" | "certifications", key?: string): Promise<DocData | undefined> {
try {
await this.fetchDocs();
let doc: DocData | undefined;
if (namespace === "root") {
if (namespace === "root" || key === "index") {
doc = this.getFromCache(`/${namespace}`);
} else {
doc = this.getFromCache(`/${namespace}/${key}`);