* Add prev/next navigation to blog posts, reduce index gap * Add download/GitHub CTA to all blog posts via layout * Track blog post slug in PostHog download/GitHub click events
20 lines
544 B
TypeScript
20 lines
544 B
TypeScript
"use client";
|
|
|
|
import { usePathname } from "next/navigation";
|
|
import { DownloadButton } from "./download-button";
|
|
import { GitHubButton } from "./github-button";
|
|
|
|
export function BlogCTA() {
|
|
const pathname = usePathname();
|
|
if (pathname === "/blog") return null;
|
|
|
|
const slug = pathname.replace("/blog/", "");
|
|
const location = `blog-${slug}`;
|
|
|
|
return (
|
|
<div className="flex flex-wrap items-center justify-center gap-3 mt-12">
|
|
<DownloadButton location={location} />
|
|
<GitHubButton location={location} />
|
|
</div>
|
|
);
|
|
}
|