Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
caesr-pub
jekyll-scholar-extras
Commits
4711ad84
Commit
4711ad84
authored
May 23, 2012
by
root
Committed by
Hiren Patel
May 23, 2012
Browse files
customized utils
parent
80ecbafc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
lib/jekyll/scholar/extras/extra_utils.rb
lib/jekyll/scholar/extras/extra_utils.rb
+35
-0
No files found.
lib/jekyll/scholar/extras/extra_utils.rb
0 → 100644
View file @
4711ad84
module
Jekyll
class
Scholar
module
ExtraUtilities
attr_reader
:bibtex_file
,
:config
,
:site
def
bibtex_options
@bibtex_options
||=
{
:filter
=>
:latex
}
end
def
bibtex_path
@bibtex_path
||=
extend_path
(
bibtex_file
)
end
def
bibliography
@bibliography
||=
BibTeX
.
open
(
bibtex_path
,
bibtex_options
)
end
def
entries_public
puts
'entries public only'
b
=
bibliography
[
config
[
'query'
]]
unless
config
[
'sort_by'
]
==
'none'
b
.
sort_by!
{
|
e
|
e
[
config
[
'sort_by'
]].
to_s
}
b
.
reverse!
if
config
[
'order'
]
=~
/^(desc|reverse)/i
end
b
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment