Skip to content

Commit

Permalink
Merge pull request #1187 from adsabs/bugfix-1184-add-page-number-to-h…
Browse files Browse the repository at this point in the history
…ighwire

#1184 Add Start Page To Citation Highwire
  • Loading branch information
ehenneken authored Jun 16, 2017
2 parents b424176 + 540715d commit 68a181e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/js/widgets/abstract/templates/metadata_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
{{#each author}}
<meta name="citation_author" content="{{this}}" data-highwire="true">
{{/each}}
{{#if page}}
<meta name="citation_firstpage" content="{{page}}" data-highwire="true">
{{/if}}
{{#if pubdate}}
<meta name="citation_publication_date" content="{{pubdate}}" data-highwire="true">
{{/if}}
Expand All @@ -16,4 +19,4 @@
{{/if}}
{{#if doi}}
<meta name="citation_doi" content="{{doi.doi}}" data-highwire="true">
{{/if}}
{{/if}}
7 changes: 6 additions & 1 deletion src/js/widgets/abstract/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ define([
abstract: undefined,
title: undefined,
authorAff: undefined,
page: undefined,
pub: undefined,
pubdate: undefined,
keywords: undefined,
Expand Down Expand Up @@ -70,6 +71,10 @@ define([
doc.authorAff = _.zip(doc.author, _.range(doc.author.length));
}

if (doc.page && doc.page.length) {
doc.page = doc.page[0];
}

//only true if there was an author array
//now add urls
if (doc.authorAff){
Expand Down Expand Up @@ -208,7 +213,7 @@ define([
},

defaultQueryArguments: {
fl: 'title,abstract,bibcode,author,keyword,id,citation_count,[citations],pub,aff,volume,pubdate,doi,pub_raw',
fl: 'title,abstract,bibcode,author,keyword,id,citation_count,[citations],pub,aff,volume,pubdate,doi,pub_raw,page',
rows: 40
},

Expand Down

0 comments on commit 68a181e

Please sign in to comment.