Skip to content

Commit

Permalink
feat: updated streak display in dynamic images (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
akorchyn authored Oct 25, 2024
1 parent d7eddb0 commit 3883f2d
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 147 deletions.
179 changes: 88 additions & 91 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions public/templates/badge_bot_template_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions public/templates/badge_bot_template_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions public/templates/badge_bot_with_pr_info_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions public/templates/badge_bot_with_pr_info_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions public/templates/badge_meta_template.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions public/templates/badge_share_template_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions public/templates/badge_share_template_white.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions server/src/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ pub async fn generate_svg_badge(
"{total-contributions}",
&total_period.prs_opened.to_string(),
)
.replace("{week-streak}", &week_streak.amount.to_string())
.replace("{max-week-streak}", &week_streak.best.to_string())
.replace("{month-streak}", &month_streak.amount.to_string())
.replace("{max-month-streak}", &month_streak.best.to_string())
.replace("{place}", &place)
.replace("{place-type}", &place_type)
Expand Down Expand Up @@ -165,7 +167,9 @@ pub async fn generate_png_meta_badge(
"{total-rating}",
&total_period.total_rating.to_formatted_string(&Locale::en),
)
.replace("{week-streak}", &week_streak.amount.to_string())
.replace("{max-week-streak}", &week_streak.best.to_string())
.replace("{month-streak}", &month_streak.amount.to_string())
.replace("{max-month-streak}", &month_streak.best.to_string())
.replace("{place}", &place)
.replace("{place-type}", &place_type)
Expand Down

0 comments on commit 3883f2d

Please sign in to comment.