Skip to content

Commit 3e85ee4

Browse files
committed
working on getting papers to display
1 parent 05a08b3 commit 3e85ee4

16 files changed

Lines changed: 162 additions & 29 deletions

_includes/themes/lab/paper.html

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,26 @@
2323
</div>
2424
</div>
2525
</div>
26-
</div>
26+
</div>
2727
</div>
2828

2929
<div class="bigspacer"></div>
3030

3131
<div class="row">
3232
<div class="col-md-3">
3333
<div class="bigspacer"></div>
34-
<div class="glyphbox note">
35-
{% if page.pdf %}
34+
<div class="glyphbox note"> <!-- DAD: what is this class? -->
35+
{% if page.pdf %}
3636
<div class="smallhead">
3737
PDF
3838
</div>
3939
<div class="pad-left note">
4040
<div class="smallspacer"></div>
4141
<i class="fa fa-file-text-o fa-fw"></i>
4242
<a class="off" href="{{ page.pdf }}">{{ page.pdf | split: '/' | last }}</a>
43-
</div>
44-
<div class="bigspacer"></div>
45-
{% endif %}
43+
</div>
44+
<div class="bigspacer"></div>
45+
{% endif %}
4646
{% if page.supplement %}
4747
<div class="smallhead">
4848
Supplement
@@ -51,20 +51,20 @@
5151
<div class="smallspacer"></div>
5252
<i class="fa fa-paperclip fa-fw"></i>
5353
<a class="off" href="{{ page.supplement }}">{{ page.supplement | split: '/' | last }}</a>
54-
</div>
55-
<div class="bigspacer"></div>
54+
</div>
55+
<div class="bigspacer"></div>
5656
{% endif %}
5757
{% if page.doi %}
5858
<div class="smallhead">
5959
DOI
60-
</div>
60+
</div>
6161
<div class="pad-left note">
6262
<div class="smallspacer"></div>
6363
<i class="fa fa-external-link fa-fw"></i>
6464
<a class="off" href="http://dx.doi.org/{{ page.doi }}">{{ page.doi }}</a>
65-
</div>
66-
<div class="bigspacer"></div>
67-
{% endif %}
65+
</div>
66+
<div class="bigspacer"></div>
67+
{% endif %}
6868
{% if page.github %}
6969
<div class="smallhead">
7070
Source code
@@ -73,23 +73,25 @@
7373
<div class="smallspacer"></div>
7474
<i class="fa fa-cog fa-fw"></i>
7575
<a class="off" href="{{ page.github }}">{{ page.github | remove: 'http://' | remove: 'https://' }}</a>
76-
</div>
77-
<div class="bigspacer"></div>
76+
</div>
77+
<div class="bigspacer"></div>
7878
{% endif %}
7979
<div class="smallhead">
8080
Share
81-
</div>
81+
</div>
82+
8283
<div class="pad-left note">
8384
<div class="smallspacer"></div>
8485
{% tweet {{page.url}} {{page.title}} %}
85-
{% trackback {{page.url}} %}
86-
</div>
86+
{% trackback {{page.url}} %}
8787
</div>
88+
89+
</div>
8890
</div>
8991
<div class="col-md-8">
9092
<div class="post">
9193
{{ content }}
9294
</div>
93-
</div>
94-
<div class="col-md-1"></div>
95+
</div>
96+
<div class="col-md-1"></div>
9597
</div>

_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
theme :
3-
name : bootstrap-3
3+
name : lab
44
---
55
{% include JB/setup %}
66
{% include themes/lab/default.html %}

_layouts/page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
theme :
3-
name : bootstrap-3
3+
name : lab
44
layout: default
55
---
66
{% include JB/setup %}

_layouts/post.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
theme :
3-
name : bootstrap-3
3+
name : lab
44
layout: default
55
---
66
{% include JB/setup %}

_layouts/protocol.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
theme :
3-
name : bootstrap-3
3+
name : lab
44
layout: default
55
---
66
{% include JB/setup %}

_plugins/trackback.rb

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Author: Trevor Bedford
2+
# License: MIT
3+
4+
# Examples:
5+
# {% trackback url %}
6+
# {% trackback {{page.url}} %}
7+
8+
require 'json'
9+
require 'open-uri'
10+
11+
module Jekyll
12+
class Trackback < Liquid::Tag
13+
def initialize(tag_name, markup, tokens)
14+
super
15+
@markup = "#{markup}".strip
16+
end
17+
def render(context)
18+
19+
url = Liquid::Template.parse(@markup).render context
20+
if url =~ /^\//
21+
url = "http://drummondlab.github.io" + url
22+
end
23+
json_object = JSON.parse(open("http://urls.api.twitter.com/1/urls/count.json?url=#{url}").read)
24+
count = json_object["count"]
25+
topsy_url = url.gsub(/:/, '%3A').gsub(/\//, '%2F')
26+
27+
html = ""
28+
if count > 0
29+
html += "<span class=\"smallnote\">"
30+
html += "<i class=\"fa fa-angle-left\"></i> "
31+
html += "<a class=\"off\" href=\"http://topsy.com/trackback?url=#{topsy_url}\">"
32+
html += "#{count}"
33+
html += "</a>"
34+
html += "</span>"
35+
end
36+
37+
html
38+
39+
end
40+
end
41+
end
42+
43+
Liquid::Template.register_tag('trackback', Jekyll::Trackback)

_plugins/tweet.rb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Author: Trevor Bedford
2+
# License: MIT
3+
4+
# Examples:
5+
# {% tweet url description %}
6+
# {% tweet {{page.url}} {{page.title}} %}
7+
8+
9+
module Jekyll
10+
class Tweet < Liquid::Tag
11+
def initialize(tag_name, markup, tokens)
12+
super
13+
@markup = "#{markup}".strip
14+
end
15+
def render(context)
16+
17+
parsed = Liquid::Template.parse(@markup).render context
18+
url = parsed.split(/ /).first
19+
if url =~ /^\//
20+
url = "http://drummondlab.github.io" + url
21+
end
22+
text = parsed.split(/ /).drop(1).join(' ')
23+
html = ""
24+
url.gsub!(/ /, '%20')
25+
text.gsub!(/ /, '%20')
26+
html += "<i class=\"fa fa-twitter fa-fw\"></i> "
27+
html += "<a class=\"off\" href=\"http://twitter.com/share?url=#{url}&text=#{text}\" target=\"_blank\">"
28+
html += "tweet"
29+
html += "</a>"
30+
html
31+
32+
end
33+
end
34+
end
35+
36+
Liquid::Template.register_tag('tweet', Jekyll::Tweet)

archive.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: page
33
title : Archive
44
header : Post Archive
5-
group: navigation
5+
group:
66
---
77
{% include JB/setup %}
88

blog/_posts/2015-04-18-about.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: post
3+
title: "About"
4+
description: ""
5+
category: misc
6+
tags: []
7+
---
8+
{% include JB/setup %}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: post
3+
title: "another one"
4+
description: ""
5+
category:
6+
tags: []
7+
---
8+
{% include JB/setup %}

0 commit comments

Comments
 (0)