fix(seo): correct canonicals and navigation semantics
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL || "https://poyrazavsever.com";
|
||||
import { SITE_URL } from "@/lib/seo";
|
||||
|
||||
function serializeJsonLd(data: object) {
|
||||
return JSON.stringify(data).replace(/</g, "\\u003c");
|
||||
|
||||
@@ -235,7 +235,7 @@ function PromoRail({
|
||||
>
|
||||
<div className="sticky top-4 py-4">
|
||||
<div
|
||||
role="tablist"
|
||||
role="group"
|
||||
aria-label={t("slideNavigationLabel")}
|
||||
onKeyDown={handleNavigationKeyDown}
|
||||
className="mb-3 flex h-5 items-center justify-center gap-2"
|
||||
@@ -247,9 +247,7 @@ function PromoRail({
|
||||
<button
|
||||
key={`${railId}-dot-${index}`}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={selected}
|
||||
aria-controls={`${railId}-panel-${index}`}
|
||||
aria-pressed={selected}
|
||||
aria-label={t("slideCta", { slide: index + 1 })}
|
||||
onClick={() => setActiveSlide(index)}
|
||||
className="group flex size-5 items-center justify-center rounded-full outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
||||
@@ -266,12 +264,19 @@ function PromoRail({
|
||||
})}
|
||||
</div>
|
||||
|
||||
<span className="sr-only" aria-live="polite">
|
||||
{t("slideStatus", {
|
||||
current: activeSlide + 1,
|
||||
total: slides.length,
|
||||
})}
|
||||
</span>
|
||||
|
||||
<div className="overflow-hidden">
|
||||
<AnimatePresence mode="wait" initial={false}>
|
||||
<motion.div
|
||||
key={`${railId}-slide-${activeSlide}`}
|
||||
id={`${railId}-panel-${activeSlide}`}
|
||||
role="tabpanel"
|
||||
role="group"
|
||||
aria-label={t("slideStatus", {
|
||||
current: activeSlide + 1,
|
||||
total: slides.length,
|
||||
|
||||
+26
-22
@@ -25,9 +25,6 @@ import {
|
||||
SheetContent,
|
||||
SheetTitle,
|
||||
SheetTrigger,
|
||||
Tabs,
|
||||
TabsList,
|
||||
TabsTrigger,
|
||||
Tooltip,
|
||||
TooltipContent,
|
||||
TooltipProvider,
|
||||
@@ -74,6 +71,18 @@ function getDesktopDropdownTriggerClass(isActive: boolean) {
|
||||
].join(" ");
|
||||
}
|
||||
|
||||
function getDesktopNavLinkClass(isActive: boolean) {
|
||||
return [
|
||||
"relative inline-flex h-9 shrink-0 items-center justify-center whitespace-nowrap rounded-sm px-2.5 text-xs font-medium outline-none",
|
||||
"transition-[color,background-color] duration-[var(--poyraz-motion-duration-fast)] ease-[var(--poyraz-motion-ease-out)]",
|
||||
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
||||
"after:absolute after:inset-x-2.5 after:bottom-0 after:h-0.5 after:rounded-full after:transition-colors",
|
||||
isActive
|
||||
? "text-foreground after:bg-primary"
|
||||
: "text-muted-foreground after:bg-transparent hover:text-foreground",
|
||||
].join(" ");
|
||||
}
|
||||
|
||||
type ThemeToggleProps = {
|
||||
theme: ThemeMode;
|
||||
onThemeChange: (theme: ThemeMode) => void;
|
||||
@@ -125,7 +134,6 @@ export function SiteNavbar({
|
||||
return pathname === href || pathname.startsWith(`${href}/`);
|
||||
};
|
||||
|
||||
const activeTab = NAV_LINKS.find((item) => isActiveLink(item.href))?.id;
|
||||
const activeMobileMenuGroup = NAV_DROPDOWN_GROUPS.find(
|
||||
(group) => group.id === mobileMenuGroupId,
|
||||
);
|
||||
@@ -204,7 +212,7 @@ export function SiteNavbar({
|
||||
className="inline-flex shrink-0 items-center"
|
||||
>
|
||||
<Logo
|
||||
src="/logo/logo.webp"
|
||||
src="/logo/logo-96.webp"
|
||||
alt="Poyraz Avsever"
|
||||
width={40}
|
||||
height={40}
|
||||
@@ -216,13 +224,10 @@ export function SiteNavbar({
|
||||
</Link>
|
||||
|
||||
<div className="hidden min-w-0 flex-1 items-center justify-end gap-2 min-[840px]:flex">
|
||||
<Tabs value={activeTab ?? ""} className="w-auto shrink-0">
|
||||
<TabsList
|
||||
variant="line"
|
||||
radius="sm"
|
||||
className="h-9 gap-1 bg-transparent p-0"
|
||||
aria-label="Ana navigasyon"
|
||||
>
|
||||
<nav
|
||||
aria-label={locale === "tr" ? "Ana navigasyon" : "Main navigation"}
|
||||
className="flex h-9 w-auto shrink-0 items-center gap-1"
|
||||
>
|
||||
{NAV_LINKS.map((item, index) => (
|
||||
<Fragment key={item.id}>
|
||||
<div className="flex items-center gap-1.5">
|
||||
@@ -233,15 +238,15 @@ export function SiteNavbar({
|
||||
decorative
|
||||
/>
|
||||
)}
|
||||
<TabsTrigger
|
||||
value={item.id}
|
||||
asChild
|
||||
size="sm"
|
||||
radius="sm"
|
||||
className="cursor-pointer px-2.5"
|
||||
<Link
|
||||
href={item.href}
|
||||
aria-current={isActiveLink(item.href) ? "page" : undefined}
|
||||
className={getDesktopNavLinkClass(
|
||||
isActiveLink(item.href),
|
||||
)}
|
||||
>
|
||||
<Link href={item.href}>{t(item.id)}</Link>
|
||||
</TabsTrigger>
|
||||
{t(item.id)}
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{NAV_DROPDOWN_GROUPS.filter(
|
||||
@@ -316,8 +321,7 @@ export function SiteNavbar({
|
||||
))}
|
||||
</Fragment>
|
||||
))}
|
||||
</TabsList>
|
||||
</Tabs>
|
||||
</nav>
|
||||
|
||||
<Separator
|
||||
orientation="vertical"
|
||||
|
||||
Reference in New Issue
Block a user