Skip to content

Commit 4bbccc3

Browse files
committed
Add DISQUS and fix pagination
1 parent 8b05f3a commit 4bbccc3

File tree

8 files changed

+117
-52
lines changed

8 files changed

+117
-52
lines changed

_config.yml

+33-17
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,56 @@
11
# -----------------------------------------------------------------------------
22
# Site settings
33
# -----------------------------------------------------------------------------
4-
54
name: Your Name
65
email: you@example.com
76
description: > # this means to ignore newlines until "url:"
87
A simple, whitespace theme for academics. Based on [*folio](https://github.com/bogoli/-folio) design.
9-
last_updated:
8+
footer_text: >
9+
Powered by <a href="http://jekyllrb.com/" target="_blank">Jekyll</a> with <a href="https://github.com/alshedivat/al-folio">al-folio</a> theme.
10+
Hosted by <a href="https://pages.github.com/" target="_blank">GitHub Pages</a>.
11+
Photos from <a href="https://unsplash.com" target="_blank">Unsplash</a>.
1012
1113
url: # the base hostname & protocol for your site
1214
baseurl: /al-folio # the subpath of your site, e.g. /blog/
15+
last_updated: # leave blank if you don't want to display last updated
1316

14-
# Social
17+
# -----------------------------------------------------------------------------
18+
# Social integration
19+
# -----------------------------------------------------------------------------
1520
github_username: # put your github username
1621
twitter_username: # put your twitter username
1722
linkedin_username: # put your linkedin username
1823
scholar_authorid: # put your google scholar author id
1924
contact_note: >
2025
You can even add a little note about which of these is the best way to reach you.
2126
22-
# Footer text
23-
footer_text: >
24-
Powered by <a href="http://jekyllrb.com/" target="_blank">Jekyll</a> with <a href="https://github.com/alshedivat/al-folio">al-folio</a> theme.
25-
Hosted by <a href="https://pages.github.com/" target="_blank">GitHub Pages</a>.
26-
Photos from <a href="https://unsplash.com" target="_blank">Unsplash</a>.
27-
27+
# -----------------------------------------------------------------------------
2828
# Blog
29+
# -----------------------------------------------------------------------------
2930
blog_name: al-folio
3031
blog_description: simple whitespace theme for academics
3132

33+
# Pagination
34+
paginate: 4
35+
permalink: /blog/:year/:title/
36+
paginate_path: /blog/page:num/
37+
38+
text:
39+
pagination:
40+
newer: 'Newer'
41+
older: 'Older'
42+
43+
# Comments
44+
disqus_shortname: al-folio # put your disqus shortname
45+
46+
# Optional features
47+
show_social_icons: false
48+
enable_anchorjs: false
49+
enable_katex: true
50+
51+
# -----------------------------------------------------------------------------
3252
# Collections
53+
# -----------------------------------------------------------------------------
3354
collections:
3455
news:
3556
defaults:
@@ -43,7 +64,6 @@ collections:
4364
output: true
4465
permalink: /poetry/:path/
4566

46-
# Collection settings
4767
news_limit: 5
4868

4969
# -----------------------------------------------------------------------------
@@ -54,11 +74,6 @@ news_limit: 5
5474
markdown: kramdown
5575
highlighter: pygments
5676

57-
# Pagination
58-
paginate: 15
59-
permalink: /blog/:year/:title/
60-
paginate_path: /blog/page:num/
61-
6277
# Includes
6378
include: ['_pages']
6479

@@ -93,7 +108,8 @@ scholar:
93108
query: "@*"
94109

95110
# -----------------------------------------------------------------------------
96-
# Other advanced settings (don't touch if you are not sure)
111+
# Other settings
97112
# -----------------------------------------------------------------------------
98113
jquery_version: "1.12.4"
99-
katex_version: "0.7.0"
114+
katex_version: "0.7.1"
115+
anchorjs_version: "3.2.2"

_includes/footer.html

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
<footer class="site-footer">
1+
<footer>
22

33
<div class="wrapper">
4-
<p class="small">
5-
© Copyright {{ site.time | date: '%Y' }} {{ site.name }}.
6-
{{ site.footer_text }}
7-
{% if site.last_updated %}
8-
Last updated: {{ site.last_updated }}.
9-
{% endif %}
10-
</p>
4+
&copy; Copyright {{ site.time | date: '%Y' }} {{ site.name }}.
5+
{{ site.footer_text }}
6+
{% if site.last_updated %}
7+
Last updated: {{ site.last_updated }}.
8+
{% endif %}
119
</div>
1210

1311
</footer>

_includes/hemline.html

+11
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,21 @@
44
<!-- Load Common JS -->
55
<script src="{{ '/assets/js/common.js' | prepend: site.baseurl | prepend: site.url }}"></script>
66

7+
{% if site.enable_katex %}
78
<!-- Load KaTeX -->
89
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/{{ site.katex_version }}/katex.min.css">
910
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/{{ site.katex_version }}/katex.min.js"></script>
1011
<script src="{{ '/assets/js/katex.js' | prepend: site.baseurl | prepend: site.url }}"></script>
12+
{% endif %}
13+
14+
{% if site.enable_anchorjs %}
15+
<!-- Load Anchor JS -->
16+
<script src="//cdnjs.cloudflare.com/ajax/libs/anchor-js/{{ site.anchorjs_version }}/anchor.min.js"></script>
17+
<script>
18+
anchors.options.visible = 'always';
19+
anchors.add('article h2, article h3, article h4, article h5, article h6');
20+
</script>
21+
{% endif %}
1122

1223
<!-- Include custom icon fonts -->
1324
<link rel="stylesheet" href="{{ '/assets/css/font-awesome.min.css' | prepend: site.baseurl | prepend: site.url }}">

_includes/pagination.html

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% if paginator.total_pages != 1 %}
2+
<div class="pagination clearfix mb1 mt4">
3+
<div class="left">
4+
{% if paginator.previous_page %}
5+
{% if paginator.page == 2 %}
6+
<a class="pagination-item" href="{{ site.baseurl }}/blog/">{{ site.text.pagination.newer }}</a>
7+
{% else %}
8+
<a class="pagination-item" href="{{ paginator.previous_page_path | prepend: site.baseurl }}">{{ site.text.pagination.newer }}</a>
9+
{% endif %}
10+
{% else %}
11+
<span class="pagination-item disabled">{{ site.text.pagination.newer }}</span>
12+
{% endif %}
13+
</div>
14+
<div class="right">
15+
{% if paginator.next_page %}
16+
<a class="pagination-item" href="{{ paginator.next_page_path | prepend: site.baseurl }}">{{ site.text.pagination.older }}</a>
17+
{% else %}
18+
<span class="pagination-item disabled">{{ site.text.pagination.older }}</span>
19+
{% endif %}
20+
</div>
21+
<div class="pagination-meta">Page {{ paginator.page }} of {{ paginator.total_pages }}</div>
22+
</div>
23+
{% endif %}

_layouts/post.html

+15
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,19 @@ <h1 class="post-title">{{ page.title }}</h1>
1212
{{ content }}
1313
</article>
1414

15+
{% if site.disqus_shortname and page.comments %}
16+
<div id="disqus_thread"></div>
17+
<script type="text/javascript">
18+
var disqus_shortname = '{{ site.disqus_shortname }}';
19+
var disqus_identifier = '{{ page.id }}';
20+
var disqus_title = {{ page.title | jsonify }};
21+
(function() {
22+
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
23+
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
24+
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
25+
})();
26+
</script>
27+
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
28+
{% endif %}
29+
1530
</div>

_posts/2015-05-15-images.markdown

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ description: this is what included images could look like
77
Jean shorts raw denim Vice normcore, art party High Life PBR skateboard stumptown vinyl kitsch. Fingerstache four loko meh 8-bit, tousled banh mi tilde forage Schlitz dreamcatcher twee 3 wolf moon. Chambray asymmetrical paleo salvia, sartorial umami four loko master cleanse drinking vinegar brunch.
88

99
<div class="img_row">
10-
<img class="col three" src="/assets/img/9.jpg">
10+
<img class="col three" src="{{ site.baseurl }}/assets/img/9.jpg">
1111
</div>
1212
<div class="img_row">
13-
<img class="col three" src="{{ site.baseurl }}/assets/img/9.jpg">
13+
<img class="col three" src="{{ site.baseurl }}/assets/img/7.jpg">
1414
</div>
1515
<div class="col three caption">
16-
A simple, elegant caption looks good between image rows, after each row, or doesn't have to be there at all.
16+
A simple, elegant caption looks good between image rows, after each row, or doesn't have to be there at all.
1717
</div>
1818
<div class="img_row">
19-
<img class="col two" src="/assets/img/8.jpg">
20-
<img class="col one" src="/assets/img/10.jpg">
19+
<img class="col two" src="{{ site.baseurl }}/assets/img/8.jpg">
20+
<img class="col one" src="{{ site.baseurl }}/assets/img/10.jpg">
2121
</div>
2222

2323
Slow-carb four dollar toast Helvetica pop-up. Kale chips next level literally trust fund Pitchfork. Jean shorts Pinterest beard, farm-to-table irony craft beer swag tofu 8-bit Banksy. Quinoa forage fanny pack, pug hashtag Echo Park heirloom Schlitz tote bag artisan Neutra mumblecore 90's shabby chic raw denim.
2424

2525

2626
<div class="img_row">
27-
<img class="col one" src="/assets/img/11.jpg">
28-
<img class="col one" src="/assets/img/12.jpg">
29-
<img class="col one" src="/assets/img/7.jpg">
27+
<img class="col one" src="{{ site.baseurl }}/assets/img/11.jpg">
28+
<img class="col one" src="{{ site.baseurl }}/assets/img/12.jpg">
29+
<img class="col one" src="{{ site.baseurl }}/assets/img/7.jpg">
3030
</div>

_posts/2015-07-15-code.markdown

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ Produces something like this:
1616

1717
int main(int argc, char const \*argv[])
1818
{
19-
string myString;
19+
string myString;
2020

21-
cout << "input a string: ";
22-
getline(cin, myString);
23-
int length = myString.length();
21+
cout << "input a string: ";
22+
getline(cin, myString);
23+
int length = myString.length();
2424

25-
char charArray = new char * [length];
25+
char charArray = new char * [length];
2626

27-
charArray = myString;
28-
for(int i = 0; i < length; ++i){
29-
cout << charArray[i] << " ";
30-
}
27+
charArray = myString;
28+
for(int i = 0; i < length; ++i){
29+
cout << charArray[i] << " ";
30+
}
3131

32-
return 0;
32+
return 0;
3333
}
3434

3535
{% endhighlight %}

blog/index.html

+11-9
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ <h2>{{ site.blog_description }}</h2>
1212

1313

1414
<ul class="post-list">
15-
{% for post in paginator.posts %}
16-
<li>
17-
<h2><a class="post-title" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h2>
18-
<p class="post-meta">{{ post.date | date: '%B %-d, %Y — %H:%M' }}</p>
19-
<p>{{ post.description }}</p>
20-
<br/>
21-
<hr/>
22-
</li>
23-
{% endfor %}
15+
{% for post in paginator.posts %}
16+
<li>
17+
<h2><a class="post-title" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h2>
18+
<p class="post-meta">{{ post.date | date: '%B %-d, %Y — %H:%M' }}</p>
19+
<p>{{ post.description }}</p>
20+
<br/>
21+
<hr/>
22+
</li>
23+
{% endfor %}
2424
</ul>
25+
26+
{% include pagination.html %}

0 commit comments

Comments
 (0)