Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

Commit

Permalink
fix(Elife): Move downloads into own section
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcmoulton committed Apr 23, 2020
1 parent f966b5b commit d2dc565
Showing 1 changed file with 44 additions and 40 deletions.
84 changes: 44 additions & 40 deletions src/themes/elife/downloads.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { after, append, create, select } from '../../util'
import { after, create, select } from '../../util'
import eLifeDataProvider from './eLifeDataProvider'

const getPdfUrl = async (id: string, pdfType: string): Promise<string> => {
Expand Down Expand Up @@ -51,59 +51,63 @@ const buildMenu = (
articleTitle: string,
pdfUrl: string
): void => {
append(
after(
select(':--references')[0],
create('h2', null, 'Download links'),
create('h3', null, 'Downloads'),
create(
'ul',
'section',
null,
create('h2', null, 'Download links'),
create('h3', null, 'Downloads'),
create(
'li',
'ul',
null,
create(
'a',
{ href: pdfUrl, 'data-is-download-pdf-link': true },
'Article PDF'
'li',
null,
create(
'a',
{ href: pdfUrl, 'data-is-download-pdf-link': true },
'Article PDF'
)
)
)
),
create('h3', null, 'Download citations'),
create(
'ul',
null,
create(
'li',
null,
create('a', { href: `${getUrl('bibtex', articleId)}` }, 'BibTeX')
),
create('h3', null, 'Download citations'),
create(
'li',
'ul',
null,
create('a', { href: `${getUrl('ris', articleId)}` }, 'RIS')
)
),
create('h3', null, 'Open citations'),
create(
'ul',
null,
create(
'li',
null,
create('a', { href: `${getUrl('mendeley', articleId)}` }, 'Mendeley')
),
create(
'li',
null,
create('a', { href: `${getUrl('readcube', articleId)}` }, 'ReadCube')
create(
'li',
null,
create('a', { href: `${getUrl('bibtex', articleId)}` }, 'BibTeX')
),
create(
'li',
null,
create('a', { href: `${getUrl('ris', articleId)}` }, 'RIS')
)
),
create('h3', null, 'Open citations'),
create(
'li',
'ul',
null,
create(
'a',
{ href: `${getUrl('papers', articleId, articleTitle)}` },
'Papers'
'li',
null,
create('a', { href: `${getUrl('mendeley', articleId)}` }, 'Mendeley')
),
create(
'li',
null,
create('a', { href: `${getUrl('readcube', articleId)}` }, 'ReadCube')
),
create(
'li',
null,
create(
'a',
{ href: `${getUrl('papers', articleId, articleTitle)}` },
'Papers'
)
)
)
)
Expand Down

0 comments on commit d2dc565

Please sign in to comment.