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

Commit

Permalink
feat(Elife): Remove obsolete CiteULike ref
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcmoulton committed Mar 13, 2020
1 parent 7e540e3 commit 746eace
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
15 changes: 3 additions & 12 deletions src/themes/elife/downloads.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { append, create, select } from '../../util';
import { append, create, select } from '../../util'

const getUrl = (type: string, id: string, title = ''): string => {
switch (type) {
Expand All @@ -14,10 +14,6 @@ const getUrl = (type: string, id: string, title = ''): string => {
return `papers2://url/https%3A%2F%2Felifesciences.org%2Farticles%2F46206?title=${encodeURIComponent(
title
)}`
case 'citeulike':
return `http://www.citeulike.org/posturl?url=https%3A%2F%2Felifesciences.org%2Farticles%2F${id}&title=${encodeURIComponent(
title
)}&doi=10.7554/eLife.${id}`
}
return ''
}
Expand Down Expand Up @@ -62,18 +58,13 @@ export const build = (articleId: string, articleTitle: string): void => {
null,
create('a', { href: `${getUrl('readcube', articleId)}` }, 'ReadCube')
),
create(
'li',
null,
create('a', { href: `${getUrl('papers', articleId)}` }, 'Papers')
),
create(
'li',
null,
create(
'a',
{ href: `${getUrl('citeulike', articleId, articleTitle)}` },
'CiteULike'
{ href: `${getUrl('papers', articleId, articleTitle)}` },
'Papers'
)
)
)
Expand Down
5 changes: 4 additions & 1 deletion src/themes/elife/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ ready((): void => {
const date = new Date(dateEl.innerHTML)
dateEl.innerHTML = formatDate(date)

downloads.build('TheArticleId', 'The Article Title')
downloads.build(
'TheArticleId',
first(':--title')?.getAttribute('content') ?? ''
)
})

0 comments on commit 746eace

Please sign in to comment.