Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

Commit 3e5f27d

Browse files
Now fix the SEO
1 parent 653f921 commit 3e5f27d

File tree

1 file changed

+25
-7
lines changed
  • packages/section-blog-theme/components/Layouts

1 file changed

+25
-7
lines changed

packages/section-blog-theme/components/Layouts/Read.tsx

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,18 @@ export function Read({ pageOpts, themeConfig, children }: { pageOpts: PageOpts;
1717

1818
let { DateFormat, settings } = themeConfig;
1919

20-
let getDate = dayjs(frontMatter.date).format(DateFormat? DateFormat : "MMM DD, YYYY");
20+
let getDate = dayjs(frontMatter.date).format(DateFormat ? DateFormat : "MMM DD, YYYY");
2121

22+
let getTag = slugify(frontMatter.tags[0])
23+
24+
let getSite = settings?.SiteURL
25+
26+
let getAuthorURL = frontMatter?.author?.url
27+
28+
let getTagURL = Next_URL(getSite) + "tags/" + getTag
29+
30+
let getRwebURL = Next_URL(getSite) + (pageOpts.route.replace("/",""))
31+
2232
return (
2333
<>
2434

@@ -35,46 +45,54 @@ export function Read({ pageOpts, themeConfig, children }: { pageOpts: PageOpts;
3545

3646
typeof frontMatter.author === 'string' ?
3747
<Link
38-
href={Next_URL(settings?.SiteURL)}
48+
href={Next_URL(getSite)}
3949
rel="author"
40-
className="mr-2 hover:text-gray-600"
50+
className="mr-2 hover:text-gray-700"
4151
>
4252
{frontMatter?.author}
4353
</Link> : typeof frontMatter.author === 'object' ? <Link
44-
href={frontMatter?.author?.url}
54+
href={getAuthorURL}
4555
target="_blank"
4656
rel="author"
4757
className="mr-2 hover:text-gray-600 "
4858
>
4959
{frontMatter?.author.name}
5060
</Link> : ""
51-
5261
} </span>
5362
<time
5463
className="mx-2"
5564
dateTime={getDate}
5665
title={getDate}
5766
>
5867
{getDate}
59-
</time><Link href={`${Next_URL(settings?.SiteURL)}/tags/${slugify(frontMatter.tags[0])}`} className="capitalize ml-2 hover:text-gray-600"> {frontMatter.tags[0]} </Link>
68+
</time><Link href={getTagURL} className="capitalize ml-2 hover:text-gray-600"> {frontMatter.tags[0]} </Link>
6069
</div>
6170

6271
<div className="hidden sm:flex flex-row print:block">
72+
6373
<RWebShare
6474
data={{
6575
text: frontMatter.description,
66-
url: `${Next_URL(settings?.SiteURL)}${pageOpts.route}`,
76+
url: getRwebURL,
6777
title: frontMatter.title,
6878
}}
6979
onClick={() => console.log("shared successfully!")}
7080
>
81+
7182
<Button aria-label="Share a Post" variant="ghost" size="icon">
83+
7284
<Share2Icon className="h-4 w-4" />
85+
7386
</Button>
87+
7488
</RWebShare>
89+
7590
<Button aria-label="Print" onClick={() => print()} variant="ghost" size="icon">
91+
7692
<PrinterIcon className="h-4 w-4" />
93+
7794
</Button>
95+
7896
</div>
7997
</section>
8098

0 commit comments

Comments
 (0)