Skip to content

Commit

Permalink
Add giscus (#89)
Browse files Browse the repository at this point in the history
* Add discussion component to writing page

* Update discussion category and mapping

* Update navigation order in contact, index, work, and writing pages
  • Loading branch information
afnizarnur committed May 8, 2024
1 parent 35d32b5 commit b951928
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 14 deletions.
7 changes: 7 additions & 0 deletions src/assets/styles/components/_discussion.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.discussion {
padding: 44px 0px;

@include mq-down(sm) {
padding: 24px;
}
}
1 change: 1 addition & 0 deletions src/assets/styles/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
@import "components/writing/article-card";
@import "components/writing/header";
@import "components/social-card";
@import "components/discussion";

// Pages
@import "pages/home";
Expand Down
8 changes: 0 additions & 8 deletions src/assets/styles/pages/_writing.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
.writing {
&.article-content {
padding-bottom: 44px;

@include mq-down(sm) {
padding-bottom: 24px;
}
}

&--article-list {
gap: 24px;
}
Expand Down
17 changes: 17 additions & 0 deletions src/includes/writing/discussion.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="discussion">
<script src="https://giscus.app/client.js"
data-repo="afnizarnur/afnizarnur.com"
data-repo-id="MDEwOlJlcG9zaXRvcnk3ODgxMDAyNg=="
data-category="Writing"
data-category-id="DIC_kwDOBLKLqs4CfN33"
data-mapping="title"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="light"
data-lang="en"
data-loading="lazy"
crossorigin="anonymous"
async></script>
</div>
3 changes: 3 additions & 0 deletions src/layouts/writing.njk
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ layout: base
{% endfor %}
</ul>
</div>

{% include "writing/discussion.njk" %}

</r-cell>

</r-grid>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/contact.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: base
title: Contact
eleventyNavigation:
key: Contact
order: 5
order: 4
permalink: /contact/
---

Expand Down
3 changes: 0 additions & 3 deletions src/pages/index.njk
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
---
layout: base
eleventyNavigation:
key: Home
order: 1
permalink: /
---

Expand Down
2 changes: 1 addition & 1 deletion src/pages/work.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: base
title: Work
eleventyNavigation:
key: Work
order: 2
order: 1
permalink: /work/
---

Expand Down
2 changes: 1 addition & 1 deletion src/pages/writing.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: base
title: Writing
eleventyNavigation:
key: Writing
order: 3
order: 2
permalink: /writing/
---

Expand Down

0 comments on commit b951928

Please sign in to comment.