From 87ee1311c656e1a73c501c996968725dba3fd541 Mon Sep 17 00:00:00 2001 From: avitex Date: Thu, 21 Jan 2021 00:48:43 +1100 Subject: [PATCH] improve project page --- content/projects.toml | 17 +++++++++++++++++ templates/macros.html | 4 ++-- templates/shortcodes/projects.html | 14 ++++++++++++-- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/content/projects.toml b/content/projects.toml index 3d0ff3d..d7a6476 100644 --- a/content/projects.toml +++ b/content/projects.toml @@ -8,6 +8,7 @@ lang = "rust" crate = "badgen" status = "hibernation" github = "avitex/rust-badgen" +ci = false published = true [project.rust-dangerous] @@ -15,6 +16,7 @@ lang = "rust" crate = "dangerous" status = "maintained" github = "avitex/rust-dangerous" +ci = true published = true [project.rust-zc] @@ -22,6 +24,7 @@ lang = "rust" crate = "zc" status = "maintained" github = "avitex/rust-zc" +ci = true published = true [project.rust-aliasable] @@ -29,6 +32,7 @@ lang = "rust" crate = "aliasable" status = "maintained" github = "avitex/rust-aliasable" +ci = true published = true [project.rust-arae] @@ -36,6 +40,7 @@ lang = "rust" crate = "arae" status = "experimental" github = "avitex/rust-arae" +ci = false published = true [project.rust-dnscat] @@ -43,6 +48,7 @@ lang = "rust" crate = "dnscat" status = "development" github = "avitex/rust-dnscat" +ci = false published = true [project.rust-public-ip] @@ -50,6 +56,7 @@ lang = "rust" crate = "public-ip" status = "maintained" github = "avitex/rust-public-ip" +ci = false published = true [project.mdbook-tera] @@ -57,6 +64,7 @@ lang = "rust" crate = "mdbook-tera" status = "maintained" github = "avitex/mdbook-tera" +ci = false published = true [project.rust-abuseipdb] @@ -64,6 +72,7 @@ lang = "rust" crate = "abuseipdb" status = "maintained" github = "avitex/rust-abuseipdb" +ci = false published = true [project.rust-aliasable-deref-trait] @@ -71,6 +80,7 @@ lang = "rust" crate = "aliasable_deref_trait" status = "maintained" github = "avitex/rust-aliasable-deref-trait" +ci = false published = true [project.rust-feast] @@ -78,6 +88,7 @@ lang = "rust" crate = "feast" status = "experimental" github = "avitex/rust-feast" +ci = false published = true [project.battlelayer] @@ -85,6 +96,7 @@ lang = "rust" crate = "battlelayer" status = "hibernation" github = "avitex/battlelayer" +ci = false published = false ############################################################################### @@ -95,6 +107,7 @@ lang = "elixir" hex = "glicko" status = "maintained" github = "avitex/elixir-glicko" +ci = false published = true [project.elixir-rcon] @@ -102,6 +115,7 @@ lang = "elixir" hex = "rcon" status = "maintained" github = "avitex/elixir-rcon" +ci = false published = true [project.elixir-vultr] @@ -109,6 +123,7 @@ lang = "elixir" hex = "vultr" status = "hibernation" github = "avitex/elixir-vultr" +ci = false published = true [project.elixir-gitlab] @@ -116,6 +131,7 @@ lang = "elixir" hex = "gitlab" status = "hibernation" github = "avitex/elixir-gitlab" +ci = false published = false [project.typed-struct-cast] @@ -123,4 +139,5 @@ lang = "elixir" hex = "typed-struct-cast" status = "hibernation" github = "avitex/typed-struct-cast" +ci = false published = false diff --git a/templates/macros.html b/templates/macros.html index 1ebe129..3825565 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -28,8 +28,8 @@ {%- endif -%} {% endmacro meta_desc %} -{% macro status_badge(status, desc, link, color) %} - {{ self::badge(type="badge", scope="status-" ~ status ~ "-" ~ color, desc=desc, link=link) }} +{% macro status_badge(status, desc, link, color, label="status") %} + {{ self::badge(type="badge", scope=label ~ "-" ~ status ~ "-" ~ color, desc=desc, link=link) }} {% endmacro status_badge %} {% macro badge(type, scope, desc, link) %} diff --git a/templates/shortcodes/projects.html b/templates/shortcodes/projects.html index f216d9d..d08a2d5 100644 --- a/templates/shortcodes/projects.html +++ b/templates/shortcodes/projects.html @@ -7,7 +7,9 @@ Links Package Maintenance - Status + Issues + Pull Requests + Builds @@ -32,8 +34,16 @@ {{ macros::badge(type="github/issues", scope=project.github, desc="Github issues", link="https://github.com/" ~ project.github ~ "/issues") }} + + {{ macros::badge(type="github/issues-pr", scope=project.github, desc="Github PRs", link="https://github.com/" ~ project.github ~ "/pulls") }} - {{ macros::badge(type="github/workflow/status", scope=project.github ~ "/build", desc="Build status", link="https://github.com/" ~ project.github ~ "/actions?query=workflow:build") }} + + + {% if project.ci %} + {{ macros::badge(type="github/workflow/status", scope=project.github ~ "/build", desc="Build status", link="https://github.com/" ~ project.github ~ "/actions?query=workflow:build") }} + {% else %} + {{ macros::status_badge(label="build", status="unknown", color="inactive", desc="Build status", link=false) }} + {% endif %} {% endif %}