Commit fe9b1db2 authored by rmrf's avatar rmrf
Browse files

change the way pdf and ppt links are generated

parent c1181f52
......@@ -21,7 +21,8 @@ Gem::Specification.new do |s|
s.required_rubygems_version = '>= 1.3.6'
s.rubyforge_project = s.name
s.add_runtime_dependency('jekyll', '~> 1.0')
s.add_runtime_dependency('jekyll', '~> 0.11.2')
s.add_runtime_dependency('jekyll-scholar', '~> 0.0.7')
s.add_runtime_dependency('citeproc-ruby', '~> 0.0.6')
s.add_runtime_dependency('bibtex-ruby', '~> 2.0.5')
......
......@@ -36,6 +36,21 @@ module Jekyll
if generate_details?
reference << "<br />"
reference << link_to(details_link_for(entry), config['details_link'])
reference << "."
end
if entry.field?(:pdflink1) or entry.field?(:pptlink1)
reference << "<b> Downloads: </b>"
end
if entry.field?(:pdflink1)
reference << "<a href=\"" + entry[:pdflink1].to_s + "\">PDF</a>"
end
if entry.field?(:pptlink1)
reference << "<a href=\"" + entry[:pptlink1].to_s + "\">PPT</a>"
end
content_tag :br, reference
......
......@@ -35,10 +35,19 @@ module Jekyll
data['entry']['citeproc'] = CiteProc.process entry.to_citeproc, :style => config['style'],
:locale => config['locale'], :format => 'html'
name = entry.key.to_s.dup
name.gsub!(/[:\s]+/, '_')
if entry.field?(:pdflink1)
data['entry']['pdflink1']= entry[:pdflink1].to_s
end
if entry.field?(:pptlink1)
data['entry']['pptlink1']= entry[:pptlink1].to_s
end
#name = entry.key.to_s.dup
# name.gsub!(/[:\s]+/, '_')
data['entry']['pdflink'] = '../pdfs/' + name.to_s + '.pdf'
# data['entry']['pdflink'] = '../pdfs/' + name.to_s + '.pdf'
end
end
......
......@@ -11,7 +11,15 @@ no_sidebar: true
{{ page.entry.abstract }} <br />
</div>
<br />
<h3><a href="{{page.entry.pdflink}}">PDF</a> </h3>
<b>Downloads:</b>
{% if page.entry.pdflink1 == empty or page.entry.pdflink1 == nil %}
{% else %}
<a href="{{page.entry.pdflink1}}">PDF</a>
{% endif %}
{% if page.entry.pptlink1 == empty or page.entry.pptlink1 == nil %}
{% else %}
, <a href="{{page.entry.pptlink1}}">PPT</a>
{% endif %}
<br />
<h3>BibTeX:</h3>
......
@book{python,
author={M. Lutz},
year={2001},
title={Programming Python, Second Edition},
publisher={O'Reilly Media, Inc.},
address={Sebastopol, CA},
pages={1026},
pdflink1={./hello/python.pdf},
isbn={0596000855}
}
@book{ruby,
abstract = {Blah blah blah blah blah blah blah blah ... },
title = {The Ruby Programming Language},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment