From bf03a10e3929b77ce10a7ffae2ef70c9dd39fe61 Mon Sep 17 00:00:00 2001 From: msrd0 Date: Tue, 19 Sep 2023 11:12:58 +0200 Subject: [PATCH] Add repo icons for GitLab and Codeberg in default template (#357) --- src/README.j2 | 4 +++- tests/pass/default-template-codeberg/Cargo.lock | 7 +++++++ tests/pass/default-template-codeberg/Cargo.toml | 12 ++++++++++++ tests/pass/default-template-codeberg/README.md | 4 ++++ tests/pass/default-template-codeberg/lib.rs | 1 + tests/pass/default-template-github/Cargo.lock | 7 +++++++ tests/pass/default-template-github/Cargo.toml | 12 ++++++++++++ tests/pass/default-template-github/README.md | 4 ++++ tests/pass/default-template-github/lib.rs | 1 + tests/pass/default-template-gitlab/Cargo.lock | 7 +++++++ tests/pass/default-template-gitlab/Cargo.toml | 12 ++++++++++++ tests/pass/default-template-gitlab/README.md | 4 ++++ tests/pass/default-template-gitlab/lib.rs | 1 + 13 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 tests/pass/default-template-codeberg/Cargo.lock create mode 100644 tests/pass/default-template-codeberg/Cargo.toml create mode 100644 tests/pass/default-template-codeberg/README.md create mode 100644 tests/pass/default-template-codeberg/lib.rs create mode 100644 tests/pass/default-template-github/Cargo.lock create mode 100644 tests/pass/default-template-github/Cargo.toml create mode 100644 tests/pass/default-template-github/README.md create mode 100644 tests/pass/default-template-github/lib.rs create mode 100644 tests/pass/default-template-gitlab/Cargo.lock create mode 100644 tests/pass/default-template-gitlab/Cargo.toml create mode 100644 tests/pass/default-template-gitlab/README.md create mode 100644 tests/pass/default-template-gitlab/lib.rs diff --git a/src/README.j2 b/src/README.j2 index b410d1e..cbce638 100644 --- a/src/README.j2 +++ b/src/README.j2 @@ -10,7 +10,9 @@ {%- endif %} {%- endif %} {%- if repository %} - {%- if repository_host == "github.com" %} [![Source Code Repository](https://img.shields.io/badge/Code-On%20GitHub-blue?logo=GitHub)]({{ repository }}) + {%- if repository_host == "github.com" %} [![Source Code Repository](https://img.shields.io/badge/Code-On%20GitHub-blue?logo=GitHub)]({{ repository }}) + {%- elif repository_host == "gitlab.com" %} [![Source Code Repository](https://img.shields.io/badge/Code-On%20GitLab-blue?logo=GitLab)]({{ repository }}) + {%- elif repository_host == "codeberg.org" %} [![Source Code Repository](https://img.shields.io/badge/Code-On%20Codeberg-blue?logo=Codeberg)]({{ repository }}) {%- elif repository_host %} [![Source Code Repository](https://img.shields.io/badge/Code-On%20{{ repository_host | replace("-", "--") | urlencode }}-blue)]({{ repository }}) {%- endif %} {%- endif %} diff --git a/tests/pass/default-template-codeberg/Cargo.lock b/tests/pass/default-template-codeberg/Cargo.lock new file mode 100644 index 0000000..d7c8996 --- /dev/null +++ b/tests/pass/default-template-codeberg/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "default_template_codeberg" +version = "0.0.0" diff --git a/tests/pass/default-template-codeberg/Cargo.toml b/tests/pass/default-template-codeberg/Cargo.toml new file mode 100644 index 0000000..5bb0e17 --- /dev/null +++ b/tests/pass/default-template-codeberg/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "default_template_codeberg" +version = "0.0.0" +publish = false +edition = "2021" + +license = "Unlicense" +repository = "https://codeberg.org/foo/bar" +rust-version = "1.56" + +[lib] +path = "lib.rs" diff --git a/tests/pass/default-template-codeberg/README.md b/tests/pass/default-template-codeberg/README.md new file mode 100644 index 0000000..72e3a8f --- /dev/null +++ b/tests/pass/default-template-codeberg/README.md @@ -0,0 +1,4 @@ +# default_template_codeberg ![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue) [![default_template_codeberg on crates.io](https://img.shields.io/crates/v/default_template_codeberg)](https://crates.io/crates/default_template_codeberg) [![default_template_codeberg on docs.rs](https://docs.rs/default_template_codeberg/badge.svg)](https://docs.rs/default_template_codeberg) [![Source Code Repository](https://img.shields.io/badge/Code-On%20Codeberg-blue?logo=Codeberg)](https://codeberg.org/foo/bar) ![Rust Version: 1.56.0](https://img.shields.io/badge/rustc-1.56.0-orange.svg) + +An example pretending to be hosted on Codeberg. + diff --git a/tests/pass/default-template-codeberg/lib.rs b/tests/pass/default-template-codeberg/lib.rs new file mode 100644 index 0000000..397717f --- /dev/null +++ b/tests/pass/default-template-codeberg/lib.rs @@ -0,0 +1 @@ +//! An example pretending to be hosted on Codeberg. diff --git a/tests/pass/default-template-github/Cargo.lock b/tests/pass/default-template-github/Cargo.lock new file mode 100644 index 0000000..cc13a0c --- /dev/null +++ b/tests/pass/default-template-github/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "default_template_github" +version = "0.0.0" diff --git a/tests/pass/default-template-github/Cargo.toml b/tests/pass/default-template-github/Cargo.toml new file mode 100644 index 0000000..b5a17ec --- /dev/null +++ b/tests/pass/default-template-github/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "default_template_github" +version = "0.0.0" +publish = false +edition = "2021" + +license = "Unlicense" +repository = "https://github.com/foo/bar" +rust-version = "1.56" + +[lib] +path = "lib.rs" diff --git a/tests/pass/default-template-github/README.md b/tests/pass/default-template-github/README.md new file mode 100644 index 0000000..c1a763f --- /dev/null +++ b/tests/pass/default-template-github/README.md @@ -0,0 +1,4 @@ +# default_template_github ![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue) [![default_template_github on crates.io](https://img.shields.io/crates/v/default_template_github)](https://crates.io/crates/default_template_github) [![default_template_github on docs.rs](https://docs.rs/default_template_github/badge.svg)](https://docs.rs/default_template_github) [![Source Code Repository](https://img.shields.io/badge/Code-On%20GitHub-blue?logo=GitHub)](https://github.com/foo/bar) ![Rust Version: 1.56.0](https://img.shields.io/badge/rustc-1.56.0-orange.svg) + +An example pretending to be hosted on GitHub. + diff --git a/tests/pass/default-template-github/lib.rs b/tests/pass/default-template-github/lib.rs new file mode 100644 index 0000000..e46755d --- /dev/null +++ b/tests/pass/default-template-github/lib.rs @@ -0,0 +1 @@ +//! An example pretending to be hosted on GitHub. diff --git a/tests/pass/default-template-gitlab/Cargo.lock b/tests/pass/default-template-gitlab/Cargo.lock new file mode 100644 index 0000000..941153c --- /dev/null +++ b/tests/pass/default-template-gitlab/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "default_template_gitlab" +version = "0.0.0" diff --git a/tests/pass/default-template-gitlab/Cargo.toml b/tests/pass/default-template-gitlab/Cargo.toml new file mode 100644 index 0000000..b3fbbd1 --- /dev/null +++ b/tests/pass/default-template-gitlab/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "default_template_gitlab" +version = "0.0.0" +publish = false +edition = "2021" + +license = "Unlicense" +repository = "https://gitlab.com/foo/bar" +rust-version = "1.56" + +[lib] +path = "lib.rs" diff --git a/tests/pass/default-template-gitlab/README.md b/tests/pass/default-template-gitlab/README.md new file mode 100644 index 0000000..5a07f18 --- /dev/null +++ b/tests/pass/default-template-gitlab/README.md @@ -0,0 +1,4 @@ +# default_template_gitlab ![License: Unlicense](https://img.shields.io/badge/license-Unlicense-blue) [![default_template_gitlab on crates.io](https://img.shields.io/crates/v/default_template_gitlab)](https://crates.io/crates/default_template_gitlab) [![default_template_gitlab on docs.rs](https://docs.rs/default_template_gitlab/badge.svg)](https://docs.rs/default_template_gitlab) [![Source Code Repository](https://img.shields.io/badge/Code-On%20GitLab-blue?logo=GitLab)](https://gitlab.com/foo/bar) ![Rust Version: 1.56.0](https://img.shields.io/badge/rustc-1.56.0-orange.svg) + +An example pretending to be hosted on GitLab. + diff --git a/tests/pass/default-template-gitlab/lib.rs b/tests/pass/default-template-gitlab/lib.rs new file mode 100644 index 0000000..ead45a5 --- /dev/null +++ b/tests/pass/default-template-gitlab/lib.rs @@ -0,0 +1 @@ +//! An example pretending to be hosted on GitLab.