Skip to content

Add CDNJS version integration - #805

Merged
espadrine merged 1 commit into
badges:masterfrom
PeterDaveHello:cdnjs-badge
Oct 16, 2016
Merged

Add CDNJS version integration#805
espadrine merged 1 commit into
badges:masterfrom
PeterDaveHello:cdnjs-badge

Conversation

@PeterDaveHello

Copy link
Copy Markdown
Contributor

To show the latest(and usually the stable) version on CDNJS via CDNJS api.

cdnjs-jquer-version-badge-example

cc cdnjs/cdnjs#5060

@PeterDaveHello

Copy link
Copy Markdown
Contributor Author

@FredyC thanks for your review 👍

@PeterDaveHello

Copy link
Copy Markdown
Contributor Author

If it's possible please also help review #767 #768 , thank you very much 😄

@espadrine espadrine left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! The code looks good.

Comment thread server.js Outdated
var library = encodeURIComponent(match[1]); // eg, "express" or "@user/express"
var format = match[2];
var apiUrl = 'https://api.cdnjs.com/libraries/' + library + '?fields=version';
var badgeData = getBadgeData('CDNJS', data);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put cndjs in lowercase please? The left-hand side is usually all-lowercase.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated! BTW, is it possible to add link to the generated markdown code by default? Like to link to the library on CDNJS, thanks.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Certainly. You simply need to put a data-link="…" to try.html's th for the corresponding badge.

You can do that in a new patch. I will merge this one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@espadrine
espadrine merged commit 251c792 into badges:master Oct 16, 2016
@espadrine
espadrine temporarily deployed to github-pages October 16, 2016 08:45 Inactive
@PeterDaveHello
PeterDaveHello deleted the cdnjs-badge branch October 16, 2016 11:27
@PeterDaveHello

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants