Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
J
jekyll-scholar
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
caesr-pub
jekyll-scholar
Commits
6a55ebe4
Commit
6a55ebe4
authored
Jan 21, 2014
by
Sylvester Keil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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-[cfqpt
s]|\B--(?:cited|file|query|prefix|text|styl
e|))/
)
argv
=
arguments
.
split
(
/(\B-[cfqpt
Ts]|\B--(?:cited|file|query|prefix|text|style|templat
e|))/
)
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