File tree Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Expand file tree Collapse file tree 4 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ pub fn Blog() -> impl IntoView {
28
28
}
29
29
}
30
30
31
+ #[ allow( dead_code) ]
31
32
fn retrieve_blog_posts_files ( ) -> Vec < PathBuf > {
32
33
let paths = fs:: read_dir ( "./assets/posts/" ) . unwrap ( ) ;
33
34
paths
Original file line number Diff line number Diff line change
1
+ use leptos:: prelude:: * ;
2
+
3
+ #[ component]
4
+ pub fn GiscusComments ( ) -> impl IntoView {
5
+ view ! {
6
+ <div class="giscus" ></div>
7
+
8
+ <script
9
+ src="https://giscus.app/client.js"
10
+ data-repo="edpyt/blog"
11
+ data-repo-id="R_kgDOPA8L5Q"
12
+ data-category="General"
13
+ data-category-id="DIC_kwDOPA8L5c4Cr9M0"
14
+ data-mapping="url"
15
+ data-strict="0"
16
+ data-reactions-enabled="1"
17
+ data-emit-metadata="0"
18
+ data-input-position="bottom"
19
+ data-theme="preferred_color_scheme"
20
+ data-lang="en"
21
+ crossorigin="anonymous"
22
+ async
23
+ ></script>
24
+ }
25
+ }
Original file line number Diff line number Diff line change 1
1
pub mod about;
2
2
pub mod blog;
3
+ pub mod comments;
3
4
pub mod post;
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ use leptos_router::hooks::use_params;
4
4
use leptos_router:: params:: Params ;
5
5
use uuid:: Uuid ;
6
6
7
+ use crate :: pages:: comments:: GiscusComments ;
8
+
7
9
#[ derive( Params , PartialEq , Clone , Debug ) ]
8
10
struct PostParams {
9
11
post_uuid : Option < Uuid > ,
@@ -21,5 +23,7 @@ pub fn Post() -> impl IntoView {
21
23
None => Either :: Left ( view! { <p>"No post with this UUID was found." </p> } ) ,
22
24
Some ( post_uuid) => Either :: Right ( view! { <p>"Found!" { post_uuid. to_string( ) } </p> } ) ,
23
25
} }
26
+
27
+ <GiscusComments />
24
28
}
25
29
}
You can’t perform that action at this time.
0 commit comments