Skip to content

Commit

Permalink
feat: add Github stars and last commit (#587)
Browse files Browse the repository at this point in the history
* feat: add Github stars and last commit

* fix: fix alt name

* ci: create artifact for generated site
  • Loading branch information
ZimboPro authored Jan 9, 2025
1 parent adf5d4c commit 52487e5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ jobs:
run: curl -L ${BASE_URL}/${VERS}/zola-${VERS}-${ARCH}.tar.gz | tar -xz
- run: ./zola --version
- run: ./zola build
- uses: actions/upload-artifact@v4
with:
path: public
retention-days: 10
- name: Deploy
if: github.ref == 'refs/heads/master'
uses: crazy-max/ghaction-github-pages@v3
Expand Down
21 changes: 19 additions & 2 deletions templates/categories/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
{% set data = load_data(url="https://api.github.com/repos/" ~ item.name, format="json") %}
{% set name = data.name %}
{% set repository_url = data.html_url %}
{# Org or User name #}
{% set owner = data.owner.login %}
{% if data.homepage != "" %}
{% set homepage_url = data.homepage %}
{% endif %}
Expand Down Expand Up @@ -103,9 +105,8 @@
</div>
</div>

{% if item.source and item.source == 'crates' or gitter_url %}
{% if item.source or gitter_url %}
<div class="extra content">
{# only projects hosted on crates get badges for now #}

<div class="ui horizontal list">
{% if item.source and item.source == 'crates' %}
Expand Down Expand Up @@ -138,6 +139,22 @@
</div>
</div>
{% endif %}
{% if item.source and item.source == 'github' %}
<div class="item" aria-hidden="true">
<div class="content">
<a href="https://github.com/{{owner}}/{{name}}">
<img src="https://img.shields.io/github/stars/{{owner}}/{{name}}" alt="Github Stars for {{ name }}">
</a>
</div>
</div>
<div class="item" aria-hidden="true">
<div class="content">
<a href="https://github.com/{{owner}}/{{name}}">
<img src="https://img.shields.io/github/last-commit/{{owner}}/{{name}}" alt="Last commit date for {{ name }}">
</a>
</div>
</div>
{% endif %}
{% if gitter_url %}
<div class="item">
<div class="content">
Expand Down

0 comments on commit 52487e5

Please sign in to comment.