diff --git a/.github/workflows/refresh-data.yml b/.github/workflows/refresh-data.yml index 90a3627..fed5c60 100644 --- a/.github/workflows/refresh-data.yml +++ b/.github/workflows/refresh-data.yml @@ -73,6 +73,23 @@ jobs: fi fi + # Fetch README title (first H1 heading) + readme_title="null" + if readme_content=$(gh api "repos/DevExpGbb/${repo_name}/readme" --jq '.content' 2>/dev/null); then + if [ -n "$readme_content" ] && [ "$readme_content" != "null" ]; then + # Decode base64 content and extract first H1 heading + decoded_readme=$(echo "$readme_content" | base64 --decode 2>/dev/null || echo "") + if [ -n "$decoded_readme" ]; then + # Extract first # heading (supports # Title or #Title formats) + title=$(echo "$decoded_readme" | grep -m 1 -E '^#[[:space:]]*' | sed -E 's/^#+[[:space:]]*//' | sed 's/[[:space:]]*$//' || echo "") + if [ -n "$title" ]; then + # Escape the title for JSON + readme_title=$(echo "$title" | jq -Rs '.') + fi + fi + fi + fi + # Add comma separator for all but first if [ "$first" = true ]; then first=false @@ -80,9 +97,9 @@ jobs: echo "," >> /tmp/repos_with_contributors.json fi - # Add repo with contributor - echo "$repo_json" | jq --argjson tc "$top_contributor" --argjson topics "$topics_data" ' - . + { topContributor: $tc, topics: $topics } + # Add repo with contributor and readme title + echo "$repo_json" | jq --argjson tc "$top_contributor" --argjson topics "$topics_data" --argjson rt "$readme_title" ' + . + { topContributor: $tc, topics: $topics, readmeTitle: $rt } ' >> /tmp/repos_with_contributors.json done diff --git a/src/components/RepoCard.astro b/src/components/RepoCard.astro index df252cd..45f09d2 100644 --- a/src/components/RepoCard.astro +++ b/src/components/RepoCard.astro @@ -66,10 +66,17 @@ const isRecentlyUpdated = (new Date().getTime() - new Date(repo.updatedAt).getTi )} - {/* Title */} -
+ {repo.name} +
+ )} +diff --git a/src/data/repositories.json b/src/data/repositories.json index 6cf2ec5..72c9534 100644 --- a/src/data/repositories.json +++ b/src/data/repositories.json @@ -68,7 +68,8 @@ "topics": [ "github-platform", "code" - ] + ], + "readmeTitle": null }, { "createdAt": "2026-02-05T12:55:35Z", @@ -100,7 +101,8 @@ "topics": [ "ghas", "code" - ] + ], + "readmeTitle": null }, { "createdAt": "2026-01-26T17:40:23Z", @@ -173,7 +175,8 @@ "shell", "github-platform", "demo-deployable" - ] + ], + "readmeTitle": null }, { "createdAt": "2026-02-05T14:27:46Z", @@ -204,7 +207,8 @@ "avatarUrl": "https://avatars.githubusercontent.com/u/18750956?v=4", "login": "Frank802" }, - "topics": [] + "topics": [], + "readmeTitle": null }, { "createdAt": "2026-01-29T15:13:57Z", @@ -281,7 +285,8 @@ "topics": [ "github-copilot", "demo-deployable" - ] + ], + "readmeTitle": null }, { "createdAt": "2024-11-12T20:09:00Z", diff --git a/src/utils/categorize.ts b/src/utils/categorize.ts index b6e4126..c8cab5e 100644 --- a/src/utils/categorize.ts +++ b/src/utils/categorize.ts @@ -166,6 +166,7 @@ export interface Repository { updatedAt: string; stargazerCount: number; topContributor: { login: string; avatarUrl: string } | null; + readmeTitle?: string | null; } export interface CategorizedRepository extends Repository {