Skip to content

Commit

Permalink
Remove hard coded blog origin
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallku committed Jul 28, 2024
1 parent 40b7af1 commit 4c216e9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/blog/src/app/[category]/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ export function generateMetadata({ params: { category, slug } }: PostProps): Met
}

return {
metadataBase: new URL("https://marshallku.com"),
metadataBase: new URL(`${process.env.NEXT_PUBLIC_BLOG_ORIGIN}`),
title: post.data.title,
description: post.data.description,
openGraph: {
type: "article",
title: post.data.title,
description: post.data.description,
url: `https://marshallku.com/${post.slug}`,
url: `${process.env.NEXT_PUBLIC_BLOG_ORIGIN}/${post.slug}`,
publishedTime: post.data.date ? post.data.date.posted.toISOString() : "",
modifiedTime: post.data.date ? post.data.date.modified?.toISOString() : "",
tags: post.data.tags,
Expand Down
2 changes: 1 addition & 1 deletion apps/blog/src/app/recent/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function GET() {
return Response.json(
posts.slice(0, 6).map((post) => ({
title: post.data.title,
uri: `https://marshallku.com${post.slug
uri: `${process.env.NEXT_PUBLIC_BLOG_ORIGIN}${post.slug
.split("/")
.map((x) => encodeURIComponent(x))
.join("/")}`,
Expand Down
2 changes: 1 addition & 1 deletion apps/blog/src/components/InteractPost/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface InteractPostProps {
const cx = classNames(styles, "interact-post");

function InteractPost({ className, title, slug }: InteractPostProps) {
const url = `https://marshallku.com/${slug}`;
const url = `${process.env.NEXT_PUBLIC_BLOG_ORIGIN}/${slug}`;
return (
<div className={cx("", { className })}>
<ReportIssueButton title={`Discussion about ${title}`} body={`Link of the post: ${url}\n\n---\n\n`} />
Expand Down
2 changes: 1 addition & 1 deletion apps/blog/src/utils/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function formatCategoryFeed(filterFunction: (post: Post) => boolean
const posts = getPosts();
const lastBuildDate = new Date().toUTCString();
const categories = getCategories();
const host = "https://marshallku.com";
const host = process.env.NEXT_PUBLIC_BLOG_ORIGIN;
const formattedPosts = await Promise.all(
posts
.filter(filterFunction)
Expand Down

1 comment on commit 4c216e9

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visual regression test result - success

Component Story Success Viewport MisMatch Percentage
components-button string-children phone 0.00%
components-button string-children tablet 0.09%
input-input default phone 0.00%
input-input default tablet 0.00%
input-input line phone 0.00%
input-input line tablet 0.00%
input-input box phone 0.00%
input-input box tablet 0.00%
input-textarea line phone 0.00%
input-textarea line tablet 0.00%
input-textarea box phone 0.00%
input-textarea box tablet 0.00%
typography-typography default phone 0.00%
typography-typography default tablet 0.00%

Please sign in to comment.