-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev
- Loading branch information
Showing
13 changed files
with
139 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import StyledMDX from '@/app/components/mdx/styled-mdx'; | ||
import { Heading1 as H1 } from '@/app/components/reusables/headers'; | ||
import { formatDate, isSameMonthAndYear } from '@/lib/funcs/dates'; | ||
import { MediumSection } from '@/app/components/reusables/sections'; | ||
import BackUpTop from '@/app/components/reusables/back-up-top'; | ||
import type { BlogData } from '@/lib/types/mdx'; | ||
import { Badge } from '@/app/components/ui/badge'; | ||
|
||
export default function BlogSection({ post }: { post: BlogData }) { | ||
return ( | ||
<MediumSection> | ||
<H1 id={post.parsedContent.attributes.title}> | ||
{post.parsedContent.attributes.title} | ||
</H1> | ||
<div className="flex justify-between items-center mb-8 text-sm sm:max-w-[450px] md:max-w-[550px] lg:max-w-[650px] xl:max-w-[750px] "> | ||
<p className="text-sm dimmed-0"> | ||
{formatDate(post.parsedContent.attributes.firstModDate)} | ||
</p> | ||
<div> | ||
{isSameMonthAndYear(post.parsedContent.attributes.firstModDate) ? ( | ||
// TODO: replace with views | ||
<div className="average-transition opacity-0 hover:opacity-100"> | ||
<Badge variant={'outlineUpdated'}>Recent</Badge> | ||
</div> | ||
) : ( | ||
<div className="average-transition opacity-0 hover:opacity-100"> | ||
<Badge variant={'outlineArchive'}>Archive</Badge> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
<article className="text-wrap"> | ||
<StyledMDX source={post.parsedContent.body}></StyledMDX> | ||
</article> | ||
<BackUpTop /> | ||
</MediumSection> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { BlogData } from '@/lib/types/mdx'; | ||
import { BLOG_URI } from '@/lib/constants'; | ||
import { pub } from '@/lib/env'; | ||
|
||
export default function SEO({ post }: { post: BlogData }) { | ||
return ( | ||
<script | ||
type="application/ld+json" | ||
suppressHydrationWarning | ||
dangerouslySetInnerHTML={{ | ||
__html: JSON.stringify({ | ||
'@context': 'https://schema.org', | ||
'@type': 'BlogPosting', | ||
headline: post.parsedContent.attributes.title, | ||
datePublished: post.parsedContent.attributes.firstModDate, | ||
dateModified: post.parsedContent.attributes.lastModDate, | ||
description: post.parsedContent.attributes.seoTitle, | ||
url: pub.SITE_URL_PROD + BLOG_URI + `/${post.filenameSlug}`, | ||
author: { | ||
'@type': 'Person', | ||
name: 'ashgw', | ||
}, | ||
}), | ||
}} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
export const BLOG_CONTENT_PATH = '/public/blogs'; | ||
export const BLOG_URI = '/blog'; | ||
export const BLOG_API_URI = '/api/blogs'; | ||
export const Status = { | ||
OK: 200, | ||
BAD_REQUEST: 400, | ||
NOT_FOUND: 404, | ||
}; |