Skip to content

feat: add Github stars and last commit #587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading