From 000fa088db6f3d05d16403af6748c410f4c5ddb6 Mon Sep 17 00:00:00 2001 From: Ludwig Schubert Date: Fri, 1 Dec 2017 15:09:23 -0800 Subject: [PATCH 1/2] Special case citations without authors --- src/helpers/citation.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/helpers/citation.js b/src/helpers/citation.js index 1f98bf7..a419441 100644 --- a/src/helpers/citation.js +++ b/src/helpers/citation.js @@ -114,13 +114,22 @@ function doi_string(ent, new_line){ } } +function title_string(ent) { + return '' + ent.title + ' '; +} + export function bibliography_cite(ent, fancy){ if (ent){ - var cite = '' + ent.title + ' '; + var cite = title_string(ent); cite += link_string(ent) + '
'; - cite += author_string(ent, '${L}, ${I}', ', ', ' and '); - if (ent.year || ent.date){ - cite += ', ' + (ent.year || ent.date) + '. '; + if (ent.author) { + cite += author_string(ent, '${L}, ${I}', ', ', ' and '); + if (ent.year || ent.date) { + cite += ', '; + } + } + if (ent.year || ent.date) { + cite += (ent.year || ent.date) + '. '; } else { cite += '. '; } From bfcff784b1709a31e4fb9da6a123d1fb11544622 Mon Sep 17 00:00:00 2001 From: Ludwig Schubert Date: Fri, 1 Dec 2017 15:10:21 -0800 Subject: [PATCH 2/2] 2.2.14 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5b40642..e422e70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "distill-template", - "version": "2.2.13", + "version": "2.2.14", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b9d25b3..0d11ec0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "distill-template", - "version": "2.2.13", + "version": "2.2.14", "description": "Template for creating Distill articles.", "main": "dist/template.v2.js", "bin": {