mirror of
https://github.com/10h30/astroplate.git
synced 2026-07-16 21:23:30 +09:00
changed the content folder structure && fixed breadcrumps
This commit is contained in:
@@ -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">
|
||||
|
||||
@@ -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, " ")) || "",
|
||||
|
||||
Reference in New Issue
Block a user