Compare commits

...
4 Commits
Author SHA1 Message Date
Ludwig Schubert c75787615e 2.2.17 2017-12-01 15:23:52 -08:00
Shan Carter c2ef8e38c3 merge 2017-12-01 15:22:27 -08:00
Ludwig Schubert bfcff784b1 2.2.14 2017-12-01 15:10:21 -08:00
Ludwig Schubert 000fa088db Special case citations without authors 2017-12-01 15:09:23 -08:00
3 changed files with 15 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "distill-template", "name": "distill-template",
"version": "2.2.16", "version": "2.2.17",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "distill-template", "name": "distill-template",
"version": "2.2.16", "version": "2.2.17",
"description": "Template for creating Distill articles.", "description": "Template for creating Distill articles.",
"main": "dist/template.v2.js", "main": "dist/template.v2.js",
"bin": { "bin": {
+13 -4
View File
@@ -114,13 +114,22 @@ function doi_string(ent, new_line){
} }
} }
function title_string(ent) {
return '<span class="title">' + ent.title + '</span> ';
}
export function bibliography_cite(ent, fancy){ export function bibliography_cite(ent, fancy){
if (ent){ if (ent){
var cite = '<span class="title">' + ent.title + '</span> '; var cite = title_string(ent);
cite += link_string(ent) + '<br>'; cite += link_string(ent) + '<br>';
cite += author_string(ent, '${L}, ${I}', ', ', ' and '); if (ent.author) {
if (ent.year || ent.date){ cite += author_string(ent, '${L}, ${I}', ', ', ' and ');
cite += ', ' + (ent.year || ent.date) + '. '; if (ent.year || ent.date) {
cite += ', ';
}
}
if (ent.year || ent.date) {
cite += (ent.year || ent.date) + '. ';
} else { } else {
cite += '. '; cite += '. ';
} }