mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-07 04:22:04 +00:00
[examples] Adjust readmes and info endpoint (#3542)
* Adjust README links * Change example info * Fix id check
This commit is contained in:
@@ -44,16 +44,19 @@ export async function getGitHubRepoInfo(repo: Repo) {
|
||||
branch: repo.branch,
|
||||
};
|
||||
|
||||
const subdirPath = repo.repo + '/tree/' + repo.branch + '/';
|
||||
const subdirPath =
|
||||
repo.repo +
|
||||
'/tree/' +
|
||||
repo.branch +
|
||||
'/' +
|
||||
(data.id === 'zeit/now' ? 'examples/' : '');
|
||||
|
||||
if (repo.path.startsWith(subdirPath)) {
|
||||
// subdir
|
||||
data.subdir = repo.path.slice(subdirPath.length).split('/');
|
||||
}
|
||||
|
||||
const isExamples = data.id === 'zeit/now-examples' || data.id === 'zeit/now';
|
||||
|
||||
if (isExamples && data.subdir) {
|
||||
if (data.id === 'zeit/now' && data.subdir) {
|
||||
// from our examples, add `homepage` and `description` fields
|
||||
const example = data.subdir[0];
|
||||
const exampleList = await getExampleList();
|
||||
|
||||
Reference in New Issue
Block a user