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
Commits
6a55ebe4
Commit
6a55ebe4
authored
Jan 21, 2014
by
Sylvester Keil
Browse files
allow for overriding of bib template
parent
0178a0a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
lib/jekyll/scholar/utilities.rb
lib/jekyll/scholar/utilities.rb
+14
-6
No files found.
lib/jekyll/scholar/utilities.rb
View file @
6a55ebe4
...
...
@@ -36,9 +36,13 @@ module Jekyll
opts
.
on
(
'-s'
,
'--style STYLE'
)
do
|
style
|
@style
=
style
end
opts
.
on
(
'-T'
,
'--template TEMPLATE'
)
do
|
template
|
@bibliography_template
=
template
end
end
argv
=
arguments
.
split
(
/(\B-[cfqpts]|\B--(?:cited|file|query|prefix|text|style|))/
)
argv
=
arguments
.
split
(
/(\B-[cfqpt
T
s]|\B--(?:cited|file|query|prefix|text|style|
template|
))/
)
parser
.
parse
argv
.
map
(
&
:strip
).
reject
(
&
:empty?
)
end
...
...
@@ -140,24 +144,28 @@ module Jekyll
end
def
bibliography_template
return
@bibliography_template
if
@bibliography_template
@bibliography_template
||
config
[
'bibliography_template'
]
end
def
liquid_template
return
@liquid_template
if
@liquid_template
tmp
=
config
[
'
bibliography_template
'
]
||
'{{reference}}'
tmp
=
bibliography_template
case
when
tmp
.
nil?
when
tmp
.
nil?
,
tmp
.
empty?
tmp
=
'{{reference}}'
when
site
.
layouts
.
key?
(
tmp
)
tmp
=
site
.
layouts
[
tmp
].
content
end
@
bibliography
_template
=
Liquid
::
Template
.
parse
(
tmp
)
@
liquid
_template
=
Liquid
::
Template
.
parse
(
tmp
)
end
def
bibliography_tag
(
entry
,
index
)
return
missing_reference
unless
entry
bibliography
_template
.
render
({
liquid
_template
.
render
({
'entry'
=>
liquidify
(
entry
),
'reference'
=>
reference_tag
(
entry
),
'key'
=>
entry
.
key
,
...
...
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