Skip to content

Commit

Permalink
[#120] Replaced logo with a statically generated logo.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Mar 12, 2024
1 parent 9efe8e2 commit 9ebcd19
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
- Release asset packaging and upload
- [PR auto-assign](.github/workflows/assign-author.yml)
- **Documentation**
- [Readme with badges](README.dist.md)
- [Readme with badges](README.dist.md) and [generated logo](logo.png)
- [Scaffold](docs) for the documentation site
using [Just the Docs theme](https://just-the-docs.com/)
- [Terminalizer](assets/terminalizer.yml) configuration file
Expand Down
12 changes: 11 additions & 1 deletion init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,16 @@ remove_docs() {
remove_string_content_line "\/docs" ".gitattributes"
}

process_readme() {
mv README.dist.md "README.md" >/dev/null 2>&1 || true

curl "https://placehold.jp/000000/ffffff/200x200.png?text=${1// /+}&css=%7B%22border-radius%22%3A%22%20100px%22%7D" >logo.tmp.png || true
if [ -s "logo.tmp.png" ]; then
mv logo.tmp.png "logo.png" >/dev/null 2>&1 || true
fi
rm logo.tmp.png >/dev/null 2>&1 || true
}

process_internal() {
local namespace="${1}"
local project="${2}"
Expand Down Expand Up @@ -413,7 +423,7 @@ main() {
[ "${use_renovate}" != "y" ] && remove_renovate
[ "${use_docs}" != "y" ] && remove_docs

mv README.dist.md "README.md" >/dev/null 2>&1 || true
process_readme "${project}"

process_internal "${namespace}" "${project}" "${author}"

Expand Down
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions tests/scaffold/_assert_init.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ assert_files_present_common() {
assert_file_not_contains ".gitignore" "/coverage"
assert_file_exists "README.md"
assert_file_not_exists "README.dist.md"
assert_file_exists "logo.png"
assert_file_not_exists "logo.tmp.png"

assert_file_not_exists "LICENSE"
assert_file_not_exists ".github/workflows/test-scaffold.yml"
Expand Down

0 comments on commit 9ebcd19

Please sign in to comment.