Compare commits

...

24 Commits

Author SHA1 Message Date
Ludwig Schubert 6f7df48fc2 2.2.19 2017-12-04 16:50:48 -08:00
Ludwig Schubert 71450e9ba8 Fix crash when a citation has no authors in Meta tags transform 2017-12-04 16:50:39 -08:00
Shan Carter 6679b120ab 2.2.18 2017-12-01 15:38:42 -08:00
Shan Carter 8bff98944a merge 2017-12-01 15:38:31 -08:00
Shan Carter b4c8fdc56a No authors bugfix 2017-12-01 15:38:04 -08:00
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
Shan Carter f221583de8 2.2.16 2017-11-22 16:35:20 -08:00
Shan Carter cddd538f9d merge 2017-11-22 16:35:03 -08:00
Shan Carter 6f95c37c2c Update d-title.css 2017-11-22 16:33:48 -08:00
Shan Carter db3af262f2 Update d-title.css 2017-11-22 16:27:13 -08:00
Shan Carter 184e094ae9 Update d-title.css 2017-11-22 16:26:35 -08:00
Shan Carter 5ede2dd9d0 2.2.15 2017-11-22 14:43:23 -08:00
Shan Carter 2a14b4c811 2.2.14 2017-11-22 14:42:57 -08:00
Shan Carter 350b6c6f67 Update styles-base.css 2017-11-22 14:42:07 -08:00
Shan Carter 49deb31aeb 2.2.13 2017-11-21 14:56:21 -08:00
Shan Carter b5a00b7f43 Fixing wrong/old version number 2017-11-21 14:56:16 -08:00
Shan Carter 0f8f0f5962 Merge 2017-11-21 14:53:38 -08:00
Shan Carter 094f0d4c58 2.2.11 2017-11-21 14:51:44 -08:00
Shan Carter cd4594f320 Fixing NaN !== NaN problem in d-slider.js 2017-11-21 14:51:35 -08:00
Ludwig Schubert be585691c5 2.2.12 2017-11-15 11:50:01 -08:00
Ludwig Schubert b25fd66fd7 Remove stray comment in CSS 2017-11-14 22:52:36 -08:00
9 changed files with 40 additions and 32 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "distill-template",
"version": "2.2.11",
"version": "2.2.19",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "distill-template",
"version": "2.2.11",
"version": "2.2.19",
"description": "Template for creating Distill articles.",
"main": "dist/template.v2.js",
"bin": {
+14 -4
View File
@@ -40,6 +40,7 @@ export function inline_cite_long(keys){
}
function author_string(ent, template, sep, finalSep){
if (ent.author == null) { return ''; }
var names = ent.author.split(' and ');
let name_strings = names.map(name => {
name = name.trim();
@@ -114,13 +115,22 @@ function doi_string(ent, new_line){
}
}
function title_string(ent) {
return '<span class="title">' + ent.title + '</span> ';
}
export function bibliography_cite(ent, fancy){
if (ent){
var cite = '<span class="title">' + ent.title + '</span> ';
var cite = title_string(ent);
cite += link_string(ent) + '<br>';
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 += '. ';
}
+1 -1
View File
@@ -1,6 +1,6 @@
d-article {
contain: layout style;
overflow-x: hidden; // allow overflow y for e.g. hover boxes
overflow-x: hidden;
border-top: 1px solid rgba(0, 0, 0, 0.1);
padding-top: 2rem;
color: rgba(0, 0, 0, 0.8);
+4 -10
View File
@@ -14,29 +14,23 @@ d-title h1 {
grid-column: text;
font-size: 40px;
font-weight: 700;
line-height: 1.05em;
margin: 0 0 1rem;
line-height: 1.1em;
margin: 0 0 0.5rem;
}
@media(min-width: 768px) {
d-title h1 {
font-size: 60px;
font-size: 50px;
}
}
d-title p {
font-weight: 300;
font-size: 1.2rem;
line-height: 1.7em;
line-height: 1.55em;
grid-column: text;
}
@media(min-width: 768px) {
d-title p {
font-size: 1.5rem;
}
}
d-title .status {
margin-top: 0px;
font-size: 12px;
+1 -1
View File
@@ -90,7 +90,7 @@ sub {
figure {
position: relative;
margin-bottom: 2.5em;
margin-top: 2.5em;
margin-top: 1.5em;
}
figcaption+figure {
+1
View File
@@ -95,6 +95,7 @@ export default function(dom, data) {
}
function author_string(ent, template, sep, finalSep){
if (ent.author == null) { return ''; }
var names = ent.author.split(' and ');
let name_strings = names.map(name => {
name = name.trim();
+15 -13
View File
@@ -124,26 +124,28 @@ function appendHtml(el, html) {
}
function citation_meta_content(ref){
// Special test for arxiv
var content = `citation_title=${ref.title};`;
ref.author.split(' and ').forEach(name => {
name = name.trim();
let last, firsts;
if (name.indexOf(',') != -1){
last = name.split(',')[0].trim();
firsts = name.split(',')[1].trim();
} else {
last = name.split(' ').slice(-1)[0].trim();
firsts = name.split(' ').slice(0,-1).join(' ');
}
content += `citation_author=${firsts} ${last};`;
});
if (ref.author && ref.author !== '') {
ref.author.split(' and ').forEach(name => {
name = name.trim();
let last, firsts;
if (name.indexOf(',') != -1){
last = name.split(',')[0].trim();
firsts = name.split(',')[1].trim();
} else {
last = name.split(' ').slice(-1)[0].trim();
firsts = name.split(' ').slice(0,-1).join(' ');
}
content += `citation_author=${firsts} ${last};`;
});
}
if ('year' in ref) {
content += `citation_publication_date=${ref.year};`;
}
// Special test for arxiv
let arxiv_id_search = /https?:\/\/arxiv\.org\/pdf\/([0-9]*\.[0-9]*)\.pdf/.exec(ref.url);
arxiv_id_search = arxiv_id_search || /https?:\/\/arxiv\.org\/abs\/([0-9]*\.[0-9]*)/.exec(ref.url);
arxiv_id_search = arxiv_id_search || /arXiv preprint arXiv:([0-9]*\.[0-9]*)/.exec(ref.journal);
+2 -1
View File
@@ -181,6 +181,7 @@ export class Slider extends T(HTMLElement) {
static get observedAttributes() {return ['min', 'max', 'value', 'step', 'ticks', 'origin', 'tickValues', 'tickLabels']; }
attributeChangedCallback(attr, oldValue, newValue) {
if (isNaN(newValue) || newValue === undefined || newValue === null) return;
if (attr == 'min') {
this.min = +newValue;
this.setAttribute('aria-valuemin', this.min);
@@ -194,7 +195,7 @@ export class Slider extends T(HTMLElement) {
}
if (attr == 'origin') {
this.origin = +newValue;
this.update(this.value);
// this.update(this.value);
}
if (attr == 'step') {
if (newValue > 0) {