changed the content folder structure && fixed breadcrumps

This commit is contained in:
Al Murad Uzzaman
2024-05-23 15:39:53 +06:00
parent 521fd4804d
commit d5e012e6f8
54 changed files with 295 additions and 60 deletions
+5
View File
@@ -18,6 +18,11 @@ const { title, image, date, author, categories } = data.data;
const lang = getLangFromUrl(Astro.url);
const { read_more } = await getTranslations(lang as keyof ContentEntryMap);
const slugParts = data.slug.split("/");
slugParts[0] = "blog";
const modifiedSlug = slugParts.join("/");
data.slug = modifiedSlug;
---
<div class="bg-body dark:bg-darkmode-body">
+4 -3
View File
@@ -11,19 +11,20 @@ if (supportedLang.includes(paths[0])) {
lang = paths.shift()!;
}
let baseHref = lang ? `/${lang}` : "/";
let parts = [
{
label: "Home",
href: `/${lang}`,
href: baseHref,
"aria-label":
Astro.url.pathname === `/${lang}` || Astro.url.pathname === `/${lang}/`
Astro.url.pathname === baseHref || Astro.url.pathname === `${baseHref}/`
? "page"
: undefined,
},
];
paths.forEach((label: string, i: number) => {
const href = `/${lang}/${paths.slice(0, i + 1).join("/")}`;
const href = `${baseHref}${paths.slice(0, i + 1).join("/")}`;
label !== "page" &&
parts.push({
label: humanize(label.replace(".html", "").replace(/[-_]/g, " ")) || "",