Skip to content

Commit

Permalink
(wip) show more info on the list
Browse files Browse the repository at this point in the history
  • Loading branch information
mackuba committed Nov 20, 2024
1 parent a1ac4cc commit e46d156
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
8 changes: 8 additions & 0 deletions _plugins/inject_info.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Jekyll::Hooks.register :site, :post_read do |site|
data = site.data
data['projects'].each do |key, section|
section['repos'].each do |repo|
repo['info'] = data['github_info'][repo['url']]
end
end
end
1 change: 1 addition & 0 deletions assets/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ header {
li {
margin: 16px 0px;
text-align: center;
line-height: 125%;
}
}
}
Expand Down
36 changes: 32 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,38 @@
<div class="language">
<h2>{{ data.name }}</h2>
<ul>
{% for repo in data.repos %}
<li>
<a href="{{ repo.url }}">{{ repo.url }}</a>
</li>
{% assign repos = data.repos | sort: "info.stars", "first" | reverse %}
{% for repo in repos %}
{% assign info = repo.info %}
{% if info %}

{% assign dates = '' | split: '' %}
{% if info.last_release %}
{% assign dates = dates | push: info.last_release.published_at %}
{% endif %}
{% if info.last_tag %}
{% assign dates = dates | push: info.last_tag.committer_date %}
{% endif %}
{% assign last_release = dates | sort | last %}

{% if info.user_name %}
{% if info.user_name != info.user_login %}
{% assign user = '@' | append: info.user_login | append: ' (' | append: info.user_name | append: ')' %}
{% else %}
{% assign user = '@' | append: info.user_login %}
{% endif %}
{% else %}
{% assign user = '@' | append: info.user_login %}
{% endif %}

<li>
<a href="{{ repo.url }}" target="_blank">{{ info.name }}</a>
by {{ user }} *{{ info.stars }}<br>
{{ info.description }}<br>
Last release: {{ last_release | date_to_string }} |
commit: {{ info.last_commit.author_date | date_to_string }} | {{ info.license | replace: "-", " " }}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
Expand Down

0 comments on commit e46d156

Please sign in to comment.