-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a complete comment system for minima #702
Open
YURLAK
wants to merge
7
commits into
jekyll:master
Choose a base branch
from
YURLAK:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ed4f051
Add comment system
YURLAK adf3ddb
Update comments.html
YURLAK a5728b6
Update _config.yml
YURLAK 792d6b6
Update README.md
YURLAK 225b5b7
Update README.md
YURLAK 5e55481
Update README.md
YURLAK 3c39b43
Update README.md
YURLAK File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -222,24 +222,45 @@ You can *add* custom metadata to the `<head />` of your layouts by creating a fi | |||||
2. [Customize](#customization) default `_includes/custom-head.html` in your source directory and insert the given code snippet. | ||||||
|
||||||
|
||||||
### Enabling comments (via Disqus) | ||||||
### Enabling comments (via Disqus, Utterances, Giscus) | ||||||
|
||||||
Optionally, if you have a Disqus account, you can tell Jekyll to use it to show a comments section below each post. | ||||||
If you want to add comment system for your site,add the following code to the `README.md` file.If not,skip this part. | ||||||
|
||||||
:warning: `url`, e.g. `https://example.com`, must be set in you config file for Disqus to work. | ||||||
|
||||||
To enable it, after setting the url field, you also need to add the following lines to your Jekyll site: | ||||||
|
||||||
```yaml | ||||||
disqus: | ||||||
shortname: my_disqus_shortname | ||||||
``` | ||||||
|
||||||
You can find out more about Disqus' shortnames [here](https://help.disqus.com/installation/whats-a-shortname). | ||||||
|
||||||
Comments are enabled by default and will only appear in production, i.e., `JEKYLL_ENV=production` | ||||||
|
||||||
If you don't want to display comments for a particular post you can disable them by adding `comments: false` to that post's YAML Front Matter. | ||||||
# Set which comment system to use | ||||||
comments: | ||||||
# 'disqus' / 'giscus' / 'utterances' are available | ||||||
provider: # choice your comment system | ||||||
|
||||||
#Disqus | ||||||
disqus: | ||||||
shortname: my_disqus_shortname | ||||||
|
||||||
# You must install utterances github app before use.(https://github.com/apps/utterances) | ||||||
# Make sure all variables are set properly. Check below link for detail. | ||||||
# https://utteranc.es/ | ||||||
utterances: | ||||||
repo: "username/username.github.io" | ||||||
issue-term: "pathname" | ||||||
label: "Comments" | ||||||
theme: "your_theme" | ||||||
|
||||||
# You must install giscus github app before use.(https://github.com/apps/giscus) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
# Make sure all variables are set properly. Check below link for detail. | ||||||
# https://giscus.app/ | ||||||
giscus: | ||||||
repo: "username/username.github.io" | ||||||
repo-id: "your_repo_id" | ||||||
category: "your_category" | ||||||
category-id: "your_category_id" | ||||||
mapping: "pathname" | ||||||
reaction-enabled: "1" | ||||||
theme: "your_theme" | ||||||
crossorigin: "your_crossorigin" | ||||||
lang: "your_language" | ||||||
``` | ||||||
|
||||||
:warning: First, you need to enter the name of your comment system into the `provider` option (`giscus`, `utterances` or `disqus`). Second, enter the configurations of your comment system. | ||||||
|
||||||
### Author Metadata | ||||||
|
||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
{% assign provider = site.comments.provider | default:"giscus" %} | ||
{% if provider == "disqus" %} | ||
{% assign disqus = site.disqus | default:site.disqus_shortname %} | ||
{% if disqus %} | ||
<div id="disqus_thread"></div> | ||
<script> | ||
var disqus_config = function () { | ||
this.page.url = '{{ page.url | absolute_url }}'; | ||
this.page.identifier = '{{ page.url | absolute_url }}'; | ||
}; | ||
(function() { | ||
var d = document, s = d.createElement('script'); | ||
s.src = 'https://{{ site.disqus.shortname }}.disqus.com/embed.js'; | ||
s.setAttribute('data-timestamp', +new Date()); | ||
(d.head || d.body).appendChild(s); | ||
})(); | ||
</script> | ||
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript> | ||
{% endif %} | ||
{% elsif provider == "utterances" %} | ||
{% assign utterances = site.utterances %} | ||
{% if utterances.repo %} | ||
<script src="https://utteranc.es/client.js" | ||
repo={{ utterances.repo }} | ||
issue-term={{ utterances.issue-term }} | ||
label={{ utterances.label }} | ||
theme={{ utterances.theme }} | ||
crossorigin= "anonymous" | ||
async> | ||
</script> | ||
{% endif %} | ||
{% elsif provider == "giscus" %} | ||
{% assign giscus = site.giscus %} | ||
{% if giscus.repo %} | ||
<script src="https://giscus.app/client.js" | ||
data-repo={{ giscus.repo }} | ||
data-repo-id={{ giscus.repo-id }} | ||
data-category={{ giscus.category }} | ||
data-category-id={{ giscus.category-id }} | ||
data-mapping={{ giscus.mapping }} | ||
data-reactions-enabled={{ giscus.reaction-enabled }} | ||
data-theme={{ giscus.theme }} | ||
crossorigin={{ giscus.crossorigin }} | ||
data-lang={{ giscus.lang }} | ||
async> | ||
</script> | ||
{% endif %} | ||
{% endif %} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.