Skip to content

Commit 6647ee7

Browse files
authored
Merge branch 'main' into feature_support_mermaid
2 parents dc68534 + 40b2ebf commit 6647ee7

File tree

7 files changed

+65
-37
lines changed

7 files changed

+65
-37
lines changed

_config.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ stackoverflow: stackoverflow # Add your stackoverflow account
4141
# Newsletter
4242
mailchimp: "https://github.us1.list-manage.com/subscribe/post?u=8ece198b3eb260e6838461a60&id=397d90b5f4"
4343

44-
# Disqus
45-
discus_identifier: amaynez-github-io # Add your discus identifier
46-
comments_curtain: yes # leave empty to show the disqus embed directly
47-
4844
# Tracker
4945
analytics: G-R8SZS2YBZK
5046
fbadmin: ar.maybach
@@ -56,6 +52,18 @@ words_per_minute: 200
5652

5753
extensions:
5854
mermaid_enable: true
55+
56+
# Comments
57+
comments: utteranc #[disqus, utteranc]
58+
comments_opts:
59+
comments_curtain: yes # leave empty to show the disqus embed directly
60+
repo: # The GitHub repo URL. https://utteranc.es/
61+
issue_term: # The GitHub issue label
62+
label: # The GitHub comments label
63+
theme: # The GitHub comment's there. e.g. github-dark
64+
# Disqus
65+
discus_identifier: # Add your discus identifier
66+
5967
# Build settings
6068
markdown: kramdown
6169
mathjax: true

_includes/comments.html

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<section class="comment-area">
2+
<div class="comment-wrapper">
3+
{% if site.comments and site.comments_opts.comments_curtain %}
4+
<div class="row" id="comment-curtain">
5+
<div class="col-lg-8 col-sm-10 mr-auto ml-auto">
6+
<h2 class="page-subtitle">Comments</h2>
7+
<div class="comments-trigger" onClick="toggle_comments()">
8+
<i class="fa fa-comments"></i>&nbsp;&nbsp;Write a comment ...
9+
</div>
10+
</div>
11+
</div>
12+
{% endif %}
13+
14+
{% if site.comments == 'utteranc' %}
15+
{% if site.comments_opts.repo %}
16+
<div id="comment-layout">
17+
<script src="https://utteranc.es/client.js" repo="{{ site.comments_opts.repo }}"
18+
issue-term="{{ site.comments_opts.issue_term | default : title }}"
19+
label="{{ site.comments_opts.label | default : comments }}" theme="{{ site.comments_opts.theme | default : github-light }}"
20+
crossorigin="anonymous" async>
21+
</script>
22+
</div>
23+
{% endif %}
24+
{% elsif site.comments == 'disqus' and site.comments_opts.discus_identifier %}
25+
<div id="comment-layout"></div>
26+
<script>
27+
(function () {
28+
var d = document, s = d.createElement('script');
29+
s.src = '//{{ site.comments.discus_identifier }}.disqus.com/embed.js';
30+
s.setAttribute('data-timestamp', +new Date());
31+
(d.head || d.body).appendChild(s);
32+
})();
33+
</script>
34+
<noscript>Please enable JavaScript to view the comments.</noscript>
35+
{% endif %}
36+
</div>
37+
</section> <!-- End Comment Area -->

_includes/disqus.html

-26
This file was deleted.

_includes/javascripts.html

+12-3
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,14 @@
116116
{% if page.layout == "post" %}
117117
<script>
118118
function toggle_comments(){
119-
document.getElementById('comment-curtain').classList.toggle('hide')
120-
document.getElementById('disqus_thread').classList.toggle('show')
119+
var commentCurtain = document.getElementById('comment-curtain')
120+
if (commentCurtain) {
121+
commentCurtain.classList.toggle('hide')
122+
}
123+
var disqusThread = document.getElementById('comment-layout')
124+
if (disqusThread) {
125+
disqusThread.classList.toggle('show')
126+
}
121127
}
122128

123129
function copyToClipboard() {
@@ -134,7 +140,10 @@
134140

135141
$(function () {
136142
if (document.getElementById('comment-curtain') == null){
137-
document.getElementById('disqus_thread').classList.toggle('show')
143+
var disqusThread = document.getElementById('comment-layout')
144+
if (disqusThread) {
145+
disqusThread.classList.toggle('show')
146+
}
138147
}
139148

140149
var tweetTags = document.getElementsByTagName("tweet");

_layouts/post.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ <h1 class="page-title">{{ page.title }}</h1>
3535
{% include author-box.html %}
3636
{% include recent-post.html %}
3737
{% include newsletter.html %}
38-
{% include disqus.html %}
38+
{% include comments.html %}
3939
</div>
4040
</div> <!-- End Wrapper -->
4141
</article>

_posts/2021-01-25-single-neuron-perceptron.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ show_date: true
55
title: Single Neuron Perceptron
66
date: 2021-01-25 13:32:20 -0600
77
description: Single neuron perceptron that classifies elements learning quite quickly.
8-
img: posts/20210125/Perceptron.jpg
8+
img: assets/img/posts/20210125/Perceptron.jpg
99
tags: [machine learning, coding, neural networks]
1010
author: Armando Maynez
1111
github: amaynez/Perceptron/

assets/css/main.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -1064,8 +1064,8 @@ svg.menu-icon-house {
10641064
}
10651065
/* = = = = = = = = = = Post's comments = = = = = = = = = = */
10661066
.hide {display:none}
1067-
#disqus_thread {display:none}
1068-
#disqus_thread.show {display:block}
1067+
#comment-layout {display:none}
1068+
#comment-layout.show {display:block}
10691069

10701070
.comments {
10711071
margin-bottom: 2em;

0 commit comments

Comments
 (0)