From 01fb2b490cf228a1fa9df6aa965006d8917f9361 Mon Sep 17 00:00:00 2001 From: anuraghazra Date: Fri, 10 Jul 2020 11:32:59 +0530 Subject: [PATCH] fix: fix description edge case fixes #10 --- api/pin.js | 8 ++++---- readme.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/pin.js b/api/pin.js index c3c4d93..8a58668 100644 --- a/api/pin.js +++ b/api/pin.js @@ -63,6 +63,7 @@ async function fetchRepo(username, reponame) { const renderRepoCard = (repo) => { const { name, description, primaryLanguage, stargazers, forkCount } = repo; const height = 120; + return ` ${name} - ${description.slice( - 0, - 60 - )}.. + ${ + description ? description.slice(0, 60) : "No description provided" + }.. diff --git a/readme.md b/readme.md index d37df57..81a9e36 100644 --- a/readme.md +++ b/readme.md @@ -67,12 +67,12 @@ Copy paste this code into your readme and change the links. Endpoint: `api/pin?username=anuraghazra&repo=github-readme-stats` ```md -[![ReadMe Card](https://github-readme-stats.anuraghazra1.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats) +[![ReadMe Card](https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats) ``` ### Demo -[![ReadMe Card](https://github-readme-stats.anuraghazra1.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats) +[![ReadMe Card](https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats) ### Quick Tip (Align The Repo Cards) @@ -80,10 +80,10 @@ Normally you won't be able to layout the images side by side to do that you can ```md - + - + ```