Skip to content

Commit 8073d84

Browse files
committed
feat: show download vs. view for pdfs
1 parent 6b11315 commit 8073d84

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

publications/js/generate_pubs.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,10 @@ function renderPubGroup(pubData, target, category) {
203203
.html(function(d, i) {
204204
// First add paper pdf (if there is one)
205205
var supplementals = ''
206-
if (d.hasOwnProperty('pdf_link') && d.pdf_link !== '')
207-
supplementals += '<a class="pdf_link" target="_blank" href="' + d.pdf_link + '"> PDF <i class="fas fa-external-link-alt"></i></a>';
206+
if (d.hasOwnProperty('pdf_link') && d.pdf_link !== '') {
207+
const isGitHubReleaseLink = d.pdf_link.startsWith('https://github.com/parklab/parklab.github.io/releases/download/large-assets/');
208+
supplementals += `<a class="pdf_link" target="_blank" href="${d.pdf_link}"> ${isGitHubReleaseLink ? "Download" : "View"} PDF <i class="fas ${isGitHubReleaseLink ? "fa-download" : "fa-external-link-alt"}"></i></a>`;
209+
}
208210
else
209211
supplementals += ''
210212
if (d.hasOwnProperty('tutorialwebsite'))

0 commit comments

Comments
 (0)