Skip to content

Commit

Permalink
Add DISQUS and fix pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
alshedivat committed Jan 31, 2017
1 parent 8b05f3a commit 4bbccc3
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 52 deletions.
50 changes: 33 additions & 17 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,56 @@
# -----------------------------------------------------------------------------
# Site settings
# -----------------------------------------------------------------------------

name: Your Name
email: [email protected]
description: > # this means to ignore newlines until "url:"
A simple, whitespace theme for academics. Based on [*folio](https://github.com/bogoli/-folio) design.
last_updated:
footer_text: >
Powered by <a href="http://jekyllrb.com/" target="_blank">Jekyll</a> with <a href="https://github.com/alshedivat/al-folio">al-folio</a> theme.
Hosted by <a href="https://pages.github.com/" target="_blank">GitHub Pages</a>.
Photos from <a href="https://unsplash.com" target="_blank">Unsplash</a>.
url: # the base hostname & protocol for your site
baseurl: /al-folio # the subpath of your site, e.g. /blog/
last_updated: # leave blank if you don't want to display last updated

# Social
# -----------------------------------------------------------------------------
# Social integration
# -----------------------------------------------------------------------------
github_username: # put your github username
twitter_username: # put your twitter username
linkedin_username: # put your linkedin username
scholar_authorid: # put your google scholar author id
contact_note: >
You can even add a little note about which of these is the best way to reach you.
# Footer text
footer_text: >
Powered by <a href="http://jekyllrb.com/" target="_blank">Jekyll</a> with <a href="https://github.com/alshedivat/al-folio">al-folio</a> theme.
Hosted by <a href="https://pages.github.com/" target="_blank">GitHub Pages</a>.
Photos from <a href="https://unsplash.com" target="_blank">Unsplash</a>.
# -----------------------------------------------------------------------------
# Blog
# -----------------------------------------------------------------------------
blog_name: al-folio
blog_description: simple whitespace theme for academics

# Pagination
paginate: 4
permalink: /blog/:year/:title/
paginate_path: /blog/page:num/

text:
pagination:
newer: 'Newer'
older: 'Older'

# Comments
disqus_shortname: al-folio # put your disqus shortname

# Optional features
show_social_icons: false
enable_anchorjs: false
enable_katex: true

# -----------------------------------------------------------------------------
# Collections
# -----------------------------------------------------------------------------
collections:
news:
defaults:
Expand All @@ -43,7 +64,6 @@ collections:
output: true
permalink: /poetry/:path/

# Collection settings
news_limit: 5

# -----------------------------------------------------------------------------
Expand All @@ -54,11 +74,6 @@ news_limit: 5
markdown: kramdown
highlighter: pygments

# Pagination
paginate: 15
permalink: /blog/:year/:title/
paginate_path: /blog/page:num/

# Includes
include: ['_pages']

Expand Down Expand Up @@ -93,7 +108,8 @@ scholar:
query: "@*"

# -----------------------------------------------------------------------------
# Other advanced settings (don't touch if you are not sure)
# Other settings
# -----------------------------------------------------------------------------
jquery_version: "1.12.4"
katex_version: "0.7.0"
katex_version: "0.7.1"
anchorjs_version: "3.2.2"
14 changes: 6 additions & 8 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<footer class="site-footer">
<footer>

<div class="wrapper">
<p class="small">
© Copyright {{ site.time | date: '%Y' }} {{ site.name }}.
{{ site.footer_text }}
{% if site.last_updated %}
Last updated: {{ site.last_updated }}.
{% endif %}
</p>
&copy; Copyright {{ site.time | date: '%Y' }} {{ site.name }}.
{{ site.footer_text }}
{% if site.last_updated %}
Last updated: {{ site.last_updated }}.
{% endif %}
</div>

</footer>
11 changes: 11 additions & 0 deletions _includes/hemline.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@
<!-- Load Common JS -->
<script src="{{ '/assets/js/common.js' | prepend: site.baseurl | prepend: site.url }}"></script>

{% if site.enable_katex %}
<!-- Load KaTeX -->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/KaTeX/{{ site.katex_version }}/katex.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/KaTeX/{{ site.katex_version }}/katex.min.js"></script>
<script src="{{ '/assets/js/katex.js' | prepend: site.baseurl | prepend: site.url }}"></script>
{% endif %}

{% if site.enable_anchorjs %}
<!-- Load Anchor JS -->
<script src="//cdnjs.cloudflare.com/ajax/libs/anchor-js/{{ site.anchorjs_version }}/anchor.min.js"></script>
<script>
anchors.options.visible = 'always';
anchors.add('article h2, article h3, article h4, article h5, article h6');
</script>
{% endif %}

<!-- Include custom icon fonts -->
<link rel="stylesheet" href="{{ '/assets/css/font-awesome.min.css' | prepend: site.baseurl | prepend: site.url }}">
Expand Down
23 changes: 23 additions & 0 deletions _includes/pagination.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% if paginator.total_pages != 1 %}
<div class="pagination clearfix mb1 mt4">
<div class="left">
{% if paginator.previous_page %}
{% if paginator.page == 2 %}
<a class="pagination-item" href="{{ site.baseurl }}/blog/">{{ site.text.pagination.newer }}</a>
{% else %}
<a class="pagination-item" href="{{ paginator.previous_page_path | prepend: site.baseurl }}">{{ site.text.pagination.newer }}</a>
{% endif %}
{% else %}
<span class="pagination-item disabled">{{ site.text.pagination.newer }}</span>
{% endif %}
</div>
<div class="right">
{% if paginator.next_page %}
<a class="pagination-item" href="{{ paginator.next_page_path | prepend: site.baseurl }}">{{ site.text.pagination.older }}</a>
{% else %}
<span class="pagination-item disabled">{{ site.text.pagination.older }}</span>
{% endif %}
</div>
<div class="pagination-meta">Page {{ paginator.page }} of {{ paginator.total_pages }}</div>
</div>
{% endif %}
15 changes: 15 additions & 0 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,19 @@ <h1 class="post-title">{{ page.title }}</h1>
{{ content }}
</article>

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

</div>
16 changes: 8 additions & 8 deletions _posts/2015-05-15-images.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ description: this is what included images could look like
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.

<div class="img_row">
<img class="col three" src="/https/github.com/assets/img/9.jpg">
<img class="col three" src="{{ site.baseurl }}/assets/img/9.jpg">
</div>
<div class="img_row">
<img class="col three" src="{{ site.baseurl }}/assets/img/9.jpg">
<img class="col three" src="{{ site.baseurl }}/assets/img/7.jpg">
</div>
<div class="col three caption">
A simple, elegant caption looks good between image rows, after each row, or doesn't have to be there at all.
A simple, elegant caption looks good between image rows, after each row, or doesn't have to be there at all.
</div>
<div class="img_row">
<img class="col two" src="/https/github.com/assets/img/8.jpg">
<img class="col one" src="/https/github.com/assets/img/10.jpg">
<img class="col two" src="{{ site.baseurl }}/assets/img/8.jpg">
<img class="col one" src="{{ site.baseurl }}/assets/img/10.jpg">
</div>

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.


<div class="img_row">
<img class="col one" src="/https/github.com/assets/img/11.jpg">
<img class="col one" src="/https/github.com/assets/img/12.jpg">
<img class="col one" src="/https/github.com/assets/img/7.jpg">
<img class="col one" src="{{ site.baseurl }}/assets/img/11.jpg">
<img class="col one" src="{{ site.baseurl }}/assets/img/12.jpg">
<img class="col one" src="{{ site.baseurl }}/assets/img/7.jpg">
</div>
20 changes: 10 additions & 10 deletions _posts/2015-07-15-code.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ Produces something like this:

int main(int argc, char const \*argv[])
{
string myString;
string myString;

cout << "input a string: ";
getline(cin, myString);
int length = myString.length();
cout << "input a string: ";
getline(cin, myString);
int length = myString.length();

char charArray = new char * [length];
char charArray = new char * [length];

charArray = myString;
for(int i = 0; i < length; ++i){
cout << charArray[i] << " ";
}
charArray = myString;
for(int i = 0; i < length; ++i){
cout << charArray[i] << " ";
}

return 0;
return 0;
}

{% endhighlight %}
20 changes: 11 additions & 9 deletions blog/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ <h2>{{ site.blog_description }}</h2>


<ul class="post-list">
{% for post in paginator.posts %}
<li>
<h2><a class="post-title" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h2>
<p class="post-meta">{{ post.date | date: '%B %-d, %Y — %H:%M' }}</p>
<p>{{ post.description }}</p>
<br/>
<hr/>
</li>
{% endfor %}
{% for post in paginator.posts %}
<li>
<h2><a class="post-title" href="{{ post.url | prepend: site.baseurl }}">{{ post.title }}</a></h2>
<p class="post-meta">{{ post.date | date: '%B %-d, %Y — %H:%M' }}</p>
<p>{{ post.description }}</p>
<br/>
<hr/>
</li>
{% endfor %}
</ul>

{% include pagination.html %}

0 comments on commit 4bbccc3

Please sign in to comment.