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
551cccb7
Commit
551cccb7
authored
Jan 20, 2014
by
Sylvester Keil
Browse files
describe new bibliography template
parent
5819d1d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
5 deletions
+29
-5
README.md
README.md
+29
-5
No files found.
README.md
View file @
551cccb7
...
...
@@ -39,7 +39,7 @@ default configuration is as follows:
source: ./_bibliography
bibliography: references.bib
bibliography_template: "
%
{reference}"
bibliography_template: "
{
{reference}
}
"
replace_strings: true
...
...
@@ -151,19 +151,43 @@ each reference is wrapped in an HTML tag (`span` by default but you can
change this using the
`reference_tagname`
setting) with the cite key
as id. The reference string itself is governed by the rules in your
CSL style but you can also customize the main template a little bit.
By default, the template is
`
%
{reference}`
– this renders only the
reference tag. The template uses
Ruby string interpolation
and, in
By default, the template is
`
{
{reference}
}
`
– this renders only the
reference tag. The template uses
Liquid to render
and, in
addition to the reference, exposes the cite-key (as
`key`
), the
entry's
`type`
and the
`index`
in the bibliography. Thus, you could
entry's
`type`
, the
`index`
in the bibliography, and the link to
file repository as
`link`
. Thus, you could
customize the template in your configuration as follows:
scholar:
bibliography_template: <abbr>[
%
{key}]</abbr>
%
{reference}
bibliography_template: <abbr>[
{
{key}
}
]</abbr>
{
{reference}
}
This would be processed into something like:
<li><abbr>[ruby]</abbr><span id="ruby">Matsumoto, Y. (2008). <i>The Ruby Programming Language</i>. O’Reilly Media.</span></li>
If you have more complex requirements, it quickly becomes tedious to
have the template inside the configuration; for this reason, you can
also put the bibliography template into your layouts directory. Jekyll-Scholar
will load this template if the option set in your configuration matches
an existing layout (without the file extension). That is to say, if you set:
scholar:
bibliography_template: bib
And there is a file
`_layouts/bib.html`
(or with another extension) the
contents of this file will be used as the template. Please note that it is
important for this file to contain the YAML front matter! For example, this
would be a more complex template file:
---
---
{{ reference }}
{% if entry.abstract %}
<p>{{ entry.abstract %}</p>
{% endif %}
<pre>{{ entry.bibtex %}</pre>
### Citations
...
...
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