Skip to content

Commit

Permalink
feat: Add fields
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelCurrin committed Mar 8, 2020
1 parent a3c17c0 commit c51e2e7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions _plugins/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ def self.parse_repo(fetched_repo)
# A class or struct was not practical so an ad hoc hash is used here.
repo = {}
repo['name'] = fetched_repo['name']
repo['url'] = fetched_repo['url']
repo['description'] = fetched_repo['description']

repo['created_at'] = fetched_repo['createdAt']
repo['updated_at'] = fetched_repo['updatedAt']

repo['stars'] = fetched_repo['stargazers']['totalCount']
repo['forks'] = fetched_repo['forkCount']

fetched_topics = fetched_repo['repositoryTopics']['nodes']
# List of topic names.
Expand Down
2 changes: 2 additions & 0 deletions _plugins/repos_with_topics.gql
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ query ReposWithTopics {
repositories(first: 100, ownerAffiliations: OWNER, privacy: PUBLIC, orderBy: { field: NAME, direction: ASC }) {
nodes {
name
url
description
# Dates
createdAt
updatedAt
Expand Down
7 changes: 6 additions & 1 deletion all_topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ layout: page

{% assign repos = topic[1] %}
{% for repo in repos %}
* Name: {{ repo[0] }} Stars: {{ repo[1].stars }} Created: {{ repo[1].created_at }}
- [{{ repo[0] }}]({{ repo[1].url }})
* Description: {{ repo[1].description }}
* Stars: {{ repo[1].stars }}
* Forks: {{ repo[1].forks }}
* Updated: {{ repo[1].updated_at | date_to_string }}
* Created: {{ repo[1].created_at | date_to_string }}
{% endfor -%}
{% endfor %}

0 comments on commit c51e2e7

Please sign in to comment.