Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/components/blog-breadcrumbs.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { ChevronRightIcon } from "@heroicons/react/24/outline";
import Link from "@/components/link";

export default function BlogBreadcrumbs({ currentPostTitle }) {
return (
<div className="mt-4 mb-7 md:mt-2 md:mb-10">
<div className="flex flex-wrap items-center gap-2 text-sm">
<Link
className="font-normal text-gray-400 no-underline transition duration-200 ease-in hover:text-white focus:text-white"
href="/blog"
noDefaultStyles
aria-label="Blog"
>
<span>Blog</span>
<span>
<ChevronRightIcon className="inline h-5 w-10 pl-4 align-text-top" />
</span>
</Link>

<span>{currentPostTitle}</span>
</div>
</div>
);
}
8 changes: 7 additions & 1 deletion src/pages/blog/[slug].jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { gql, useQuery } from "@apollo/client";
import { WordPressBlocksViewer } from "@faustwp/blocks";
import { flatListToHierarchical, getNextStaticProps } from "@faustwp/core";
import BlogBreadcrumbs from "@/components/blog-breadcrumbs";
import Seo from "@/components/seo";
import blocks from "@/wp-blocks";

Expand All @@ -22,12 +23,17 @@ export default function SinglePost(properties) {
});

return (
<div className="prose prose-lg prose-invert container mx-auto px-4 py-20">
<div
id="main-content"
className="prose prose-lg prose-invert container mx-auto px-4 py-8"
>
<Seo
title={title}
url={uri}
description={excerpt.replaceAll(/<\/?\S+>/gm, "")}
/>

<BlogBreadcrumbs currentPostTitle={title} />
<div className="py-4">
<h1 className="mb-4">{title}</h1>
<p className="mb-8 text-sm text-gray-400">
Expand Down
4 changes: 2 additions & 2 deletions src/pages/blog/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default function BlogIndex() {

if (loading && !data)
return (
<div className="container-main flex justify-center">
<div className="container-main flex justify-center py-20">
Loading <ArrowPathIcon className="ml-2 h-5 w-5 animate-spin" />
</div>
);
Expand Down Expand Up @@ -123,7 +123,7 @@ export default function BlogIndex() {
<div className="mt-8 flex justify-center">
<button
type="button"
className="flex items-center rounded-sm bg-purple-700 px-4 py-2 text-white transition ease-in-out hover:bg-purple-800"
className="flex cursor-pointer items-center rounded-sm bg-purple-700 px-4 py-2 text-white transition ease-in-out hover:bg-purple-800"
onClick={loadMorePosts}
disabled={loadingMore}
>
Expand Down