From 463c69470b0165aa847d2bdf7faa7d623cf3ff6f Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sun, 28 Apr 2024 14:40:43 +0700 Subject: [PATCH] [Fix] project not defind homepage --- layouts/shortcodes/github-pages.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/layouts/shortcodes/github-pages.html b/layouts/shortcodes/github-pages.html index d5d1887..d32560c 100644 --- a/layouts/shortcodes/github-pages.html +++ b/layouts/shortcodes/github-pages.html @@ -43,7 +43,12 @@ const urlCell = row.insertCell(2); const repoUrl = repo.html_url; - const pagesUrl = repo.homepage; + let pagesUrl; + if (repo.homepage !== null) { + pagesUrl = repo.homepage; + } else { + pagesUrl = `https://${username}.github.io/${repo.name}` + } nameCell.innerHTML = `${repo.name}`; descriptionCell.textContent = repo.description;