mirror of
https://github.com/wassname/template.git
synced 2026-07-15 11:27:10 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f7df48fc2 | ||
|
|
71450e9ba8 |
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "distill-template",
|
"name": "distill-template",
|
||||||
"version": "2.2.18",
|
"version": "2.2.19",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "distill-template",
|
"name": "distill-template",
|
||||||
"version": "2.2.18",
|
"version": "2.2.19",
|
||||||
"description": "Template for creating Distill articles.",
|
"description": "Template for creating Distill articles.",
|
||||||
"main": "dist/template.v2.js",
|
"main": "dist/template.v2.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
+15
-13
@@ -124,26 +124,28 @@ function appendHtml(el, html) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function citation_meta_content(ref){
|
function citation_meta_content(ref){
|
||||||
// Special test for arxiv
|
|
||||||
var content = `citation_title=${ref.title};`;
|
var content = `citation_title=${ref.title};`;
|
||||||
|
|
||||||
ref.author.split(' and ').forEach(name => {
|
if (ref.author && ref.author !== '') {
|
||||||
name = name.trim();
|
ref.author.split(' and ').forEach(name => {
|
||||||
let last, firsts;
|
name = name.trim();
|
||||||
if (name.indexOf(',') != -1){
|
let last, firsts;
|
||||||
last = name.split(',')[0].trim();
|
if (name.indexOf(',') != -1){
|
||||||
firsts = name.split(',')[1].trim();
|
last = name.split(',')[0].trim();
|
||||||
} else {
|
firsts = name.split(',')[1].trim();
|
||||||
last = name.split(' ').slice(-1)[0].trim();
|
} else {
|
||||||
firsts = name.split(' ').slice(0,-1).join(' ');
|
last = name.split(' ').slice(-1)[0].trim();
|
||||||
}
|
firsts = name.split(' ').slice(0,-1).join(' ');
|
||||||
content += `citation_author=${firsts} ${last};`;
|
}
|
||||||
});
|
content += `citation_author=${firsts} ${last};`;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if ('year' in ref) {
|
if ('year' in ref) {
|
||||||
content += `citation_publication_date=${ref.year};`;
|
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);
|
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 || /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);
|
arxiv_id_search = arxiv_id_search || /arXiv preprint arXiv:([0-9]*\.[0-9]*)/.exec(ref.journal);
|
||||||
|
|||||||
Reference in New Issue
Block a user