From 52487e5d6527513d8959e7ad55e960878f590fe4 Mon Sep 17 00:00:00 2001 From: Leslie de Jager Date: Thu, 9 Jan 2025 15:26:52 +0200 Subject: [PATCH] feat: add Github stars and last commit (#587) * feat: add Github stars and last commit * fix: fix alt name * ci: create artifact for generated site --- .github/workflows/ci.yml | 4 ++++ templates/categories/macros.html | 21 +++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d95d6ee..d80c8dec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/templates/categories/macros.html b/templates/categories/macros.html index a6e65482..94c7d97d 100644 --- a/templates/categories/macros.html +++ b/templates/categories/macros.html @@ -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 %} @@ -103,9 +105,8 @@ - {% if item.source and item.source == 'crates' or gitter_url %} + {% if item.source or gitter_url %}
- {# only projects hosted on crates get badges for now #}
{% if item.source and item.source == 'crates' %} @@ -138,6 +139,22 @@
{% endif %} + {% if item.source and item.source == 'github' %} + + + {% endif %} {% if gitter_url %}