Skip to content

Commit

Permalink
including keywords in Metadata and firebase hosting.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrswastik-robot committed Mar 19, 2024
1 parent 17d90d3 commit 0db224c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 333 deletions.
11 changes: 8 additions & 3 deletions app/[postTitle]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ type Props = {
type Post = {
id: string;
title: string;
// content: string;
description: string;
// hashtags: string[];
keywords: string[];
answerKeywords: string;
}

const fetchPost = async (postTitle: string) => {
Expand All @@ -37,12 +40,14 @@ const fetchPost = async (postTitle: string) => {
}

export async function generateMetadata({ params }: Props) : Promise<Metadata> {

const postTitleWithSpaces = decodeURIComponent(params.postTitle as string).split("-").join(" ");
const { post }= await fetchPost(postTitleWithSpaces);
const metadata: Metadata = {
title: post[0].title,
description: "Discover answers to your questions.",
description: post[0].description,
keywords: post[0].keywords,
// answerKeywords: post[0].answerKeywords
};
return metadata;

Expand Down
2 changes: 1 addition & 1 deletion app/[postTitle]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ const PostPage = ({ params: { postTitle } }: Props) => {
<div className=" mt-3">
{isCommentBoxOpen ? (
<div
className="rounded-3xl border border-gray-300 p-4 cursor-pointer"
className="rounded-3xl border border-gray-300 p-4 cursor-pointer mx-2 md:mx-0 my-6"
onClick={() => setIsCommentBoxOpen(false)}
>
Write a Answer...
Expand Down
326 changes: 0 additions & 326 deletions app/postPage/[postId]/page.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion components/queAnsPage/CommentBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ const CommentBox = ({
type="text"
placeholder="Add a comment ..."
autoComplete="off"
className="w-[99%] border-0 rounded-3xl bg-slate-100 p-2"
className="w-[99%] border-0 rounded-3xl bg-slate-100 dark:bg-[#181818] p-2"
{...field}
/>
</FormControl>
Expand Down
3 changes: 1 addition & 2 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"hosting": {
"public": "public",
"source": ".",
"public": "./.firebase/gods-plan-35/hosting",
"ignore": [
"firebase.json",
"**/.*",
Expand Down
2 changes: 2 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const nextConfig = {
experimental: {
missingSuspenseWithCSRBailout: false,
},

// output: 'export',
};

export default nextConfig;

0 comments on commit 0db224c

Please sign in to comment.