From 53c5203f237491945e3a5cdb26362bc0335feacd Mon Sep 17 00:00:00 2001 From: log101 Date: Sun, 16 Jun 2024 22:05:58 +0300 Subject: [PATCH 01/18] feat: add comments section --- src/components/EmojiReactionForm.astro | 2 +- .../category/[category]/[slug]/index.astro | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/src/components/EmojiReactionForm.astro b/src/components/EmojiReactionForm.astro index 31f0e37..5f3ba04 100644 --- a/src/components/EmojiReactionForm.astro +++ b/src/components/EmojiReactionForm.astro @@ -21,7 +21,7 @@ const backendHost = import.meta.env.PUBLIC_BACKEND_HOST;
diff --git a/src/pages/category/[category]/[slug]/index.astro b/src/pages/category/[category]/[slug]/index.astro index 090b39a..890999e 100644 --- a/src/pages/category/[category]/[slug]/index.astro +++ b/src/pages/category/[category]/[slug]/index.astro @@ -18,9 +18,62 @@ export async function getStaticPaths() { } --- +
+ +
+
Yorumlar
+
+
+

Arafat Candan

+
+

+ Daha önce hiç bu açıdan bakmamıştım, harika bir yazı olmuş. +

+
+
+

Asude Fikrim

+
+

+ Keşke biraz daha uğraşsaydınız, fikirler ibtidai seviyede kalmış. + Örnek olarak falanca siteye göz gezdirebilirsiniz. +

+
+
+
+
+ + + +
+
+
+
From 68fd34c830631d72199f55c114f799b279be040c Mon Sep 17 00:00:00 2001 From: log101 Date: Tue, 18 Jun 2024 16:44:05 +0300 Subject: [PATCH 02/18] feat: add comment and comment form component --- src/components/Comment.astro | 15 ++++++ src/components/CommentForm.astro | 37 +++++++++++++ src/components/HorizontalLine.astro | 5 ++ .../category/[category]/[slug]/index.astro | 54 +++---------------- 4 files changed, 64 insertions(+), 47 deletions(-) create mode 100644 src/components/Comment.astro create mode 100644 src/components/CommentForm.astro create mode 100644 src/components/HorizontalLine.astro diff --git a/src/components/Comment.astro b/src/components/Comment.astro new file mode 100644 index 0000000..d627809 --- /dev/null +++ b/src/components/Comment.astro @@ -0,0 +1,15 @@ +--- + +--- + +
+

+ Arafat Candan +

+ +

+ Daha önce hiç bu açıdan bakmamıştım, harika bir yazı olmuş. +

+
diff --git a/src/components/CommentForm.astro b/src/components/CommentForm.astro new file mode 100644 index 0000000..3ddc01a --- /dev/null +++ b/src/components/CommentForm.astro @@ -0,0 +1,37 @@ +--- + +--- + + + +
+
+ + + + +
+
diff --git a/src/components/HorizontalLine.astro b/src/components/HorizontalLine.astro new file mode 100644 index 0000000..ad76758 --- /dev/null +++ b/src/components/HorizontalLine.astro @@ -0,0 +1,5 @@ +--- + +--- + +
diff --git a/src/pages/category/[category]/[slug]/index.astro b/src/pages/category/[category]/[slug]/index.astro index 890999e..9c5a79d 100644 --- a/src/pages/category/[category]/[slug]/index.astro +++ b/src/pages/category/[category]/[slug]/index.astro @@ -6,6 +6,9 @@ import Header from "@/components/Header.astro"; import Layout from "@/layouts/Layout.astro"; import Post from "@/components/Post.astro"; import EmojiReactionForm from "@/components/EmojiReactionForm.astro"; +import CommentForm from "@/components/CommentForm.astro"; +import HorizontalLine from "@/components/HorizontalLine.astro"; +import Comment from "@/components/Comment.astro"; const { entry } = Astro.props; @@ -18,19 +21,6 @@ export async function getStaticPaths() { } --- -
@@ -39,40 +29,10 @@ export async function getStaticPaths() {
Yorumlar
-
-

Arafat Candan

-
-

- Daha önce hiç bu açıdan bakmamıştım, harika bir yazı olmuş. -

-
-
-

Asude Fikrim

-
-

- Keşke biraz daha uğraşsaydınız, fikirler ibtidai seviyede kalmış. - Örnek olarak falanca siteye göz gezdirebilirsiniz. -

-
-
-
-
- - - -
-
+ + + +
From 132174d0c65ae85fd361a9271615893fa95f3cc4 Mon Sep 17 00:00:00 2001 From: log101 Date: Tue, 18 Jun 2024 16:50:21 +0300 Subject: [PATCH 03/18] style: add no content text --- src/pages/category/[category]/index.astro | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/pages/category/[category]/index.astro b/src/pages/category/[category]/index.astro index edfdcdf..ad6205a 100644 --- a/src/pages/category/[category]/index.astro +++ b/src/pages/category/[category]/index.astro @@ -27,9 +27,16 @@ const allTeknikPosts = await getCollection(
{ - allTeknikPosts - .sort((p1, p2) => p2.data.date.getTime() - p1.data.date.getTime()) - .map((p) => ) + allTeknikPosts.length > 0 ? ( + allTeknikPosts + .sort((p1, p2) => p2.data.date.getTime() - p1.data.date.getTime()) + .map((p) => ) + ) : ( +

+ Henüz bu kategoride bir yazı yazılmadı. Yazarımızın ilhama veya + teşviğe ihtiyacı olabilir! +

+ ) }
From 6c0b81c8836c9c43b3b4668700165db090e5d6cb Mon Sep 17 00:00:00 2001 From: log101 Date: Tue, 18 Jun 2024 21:36:47 +0300 Subject: [PATCH 04/18] style: add spacing to emoji form --- src/components/EmojiReactionForm.astro | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/EmojiReactionForm.astro b/src/components/EmojiReactionForm.astro index 5f3ba04..1eb6f63 100644 --- a/src/components/EmojiReactionForm.astro +++ b/src/components/EmojiReactionForm.astro @@ -27,22 +27,22 @@ const backendHost = import.meta.env.PUBLIC_BACKEND_HOST; >
 👍   👎   😀   😑   🤢   👀 
From 8faa7f472d74e770ea6a4415b92cacfd95e58dff Mon Sep 17 00:00:00 2001 From: log101 Date: Thu, 20 Jun 2024 19:40:55 +0300 Subject: [PATCH 05/18] feat: implement commenting --- src/components/CommentForm.astro | 26 +++++++++++++++---- src/components/EmojiReactionForm.astro | 2 +- src/layouts/Layout.astro | 1 + .../category/[category]/[slug]/index.astro | 14 +++++++--- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/src/components/CommentForm.astro b/src/components/CommentForm.astro index 3ddc01a..e80cd78 100644 --- a/src/components/CommentForm.astro +++ b/src/components/CommentForm.astro @@ -1,5 +1,6 @@ --- - +const { entryId } = Astro.props; +const backendHost = import.meta.env.PUBLIC_BACKEND_HOST; --- -
+
+ placeholder="Yazı hakkındaki düşünceleriniz nelerdir?" + name="commentBody"> - + +
+ + diff --git a/src/components/EmojiReactionForm.astro b/src/components/EmojiReactionForm.astro index 1eb6f63..e770128 100644 --- a/src/components/EmojiReactionForm.astro +++ b/src/components/EmojiReactionForm.astro @@ -15,7 +15,7 @@ const backendHost = import.meta.env.PUBLIC_BACKEND_HOST;
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 774f975..874345a 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -16,6 +16,7 @@ import "../styles/main.css"; + {title} diff --git a/src/pages/category/[category]/[slug]/index.astro b/src/pages/category/[category]/[slug]/index.astro index 9c5a79d..ae346d8 100644 --- a/src/pages/category/[category]/[slug]/index.astro +++ b/src/pages/category/[category]/[slug]/index.astro @@ -12,6 +12,8 @@ import Comment from "@/components/Comment.astro"; const { entry } = Astro.props; +const backendHost = import.meta.env.PUBLIC_BACKEND_HOST; + export async function getStaticPaths() { const blogEntries = await getCollection("blog"); return blogEntries.map((entry) => ({ @@ -29,10 +31,16 @@ export async function getStaticPaths() {
Yorumlar
- - +
+

Henüz yorum yok!

+
- +