Unverified Commit 057ff69a authored by Nathan Chu's avatar Nathan Chu Committed by GitHub
Browse files

feat: custom card title (#293)



* Custom stats title (anuraghazra#229)

* Add custom title test

* remove unused code

* Update readme.md to include the `custom_title` option

* Update readme_es.md to include `custom_title` option

Co-Authored-By: default avatarJosé Javier Rodríguez Zas <jjavierdguezas@gmail.com>

* Merge branch 'master' of https://github.com/anuraghazra/github-readme-stats.git

 into custom-title

* feat: added customTitle option in Card

Co-authored-by: default avatarJosé Javier Rodríguez Zas <jjavierdguezas@gmail.com>
Co-authored-by: default avatarAnurag <hazru.anurag@gmail.com>
parent e1932fdf
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ module.exports = async (req, res) => {
    bg_color,
    theme,
    cache_seconds,
    custom_title,
  } = req.query;
  let stats;

@@ -65,6 +66,7 @@ module.exports = async (req, res) => {
        text_color,
        bg_color,
        theme,
        custom_title,
      }),
    );
  } catch (err) {
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ module.exports = async (req, res) => {
    layout,
    langs_count,
    exclude_repo,
    custom_title,
  } = req.query;
  let topLangs;

@@ -51,6 +52,7 @@ module.exports = async (req, res) => {

    return res.send(
      renderTopLanguages(topLangs, {
        custom_title,
        hide_title: parseBoolean(hide_title),
        hide_border: parseBoolean(hide_border),
        card_width: parseInt(card_width, 10),
+2 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ module.exports = async (req, res) => {
    cache_seconds,
    hide_title,
    hide_progress,
    custom_title,
  } = req.query;

  res.setHeader("Content-Type", "image/svg+xml");
@@ -42,6 +43,7 @@ module.exports = async (req, res) => {

    return res.send(
      wakatimeCard(last7Days, {
        custom_title,
        hide_title: parseBoolean(hide_title),
        hide_border: parseBoolean(hide_border),
        line_height,
+1 −0
Original line number Diff line number Diff line
@@ -147,6 +147,7 @@ Puedes personalizar el aspecto de tu `Stats Card` o `Repo Card` de la manera que
- `include_all_commits` - Cuente los commits totales en lugar de solo los commits del año actual _(boolean)_
- `count_private` - Cuenta los commits privadas _(boolean)_
- `line_height` - Establece el alto de línea entre texto _(number)_
- `custom_title` - Establece un título personalizado

#### Opciones exclusivas de la tarjeta Repo:

+3 −0
Original line number Diff line number Diff line
@@ -157,6 +157,7 @@ You can provide multiple comma-separated values in bg_color option to render a g
- `include_all_commits` - Count total commits instead of just the current year commits _(boolean)_
- `count_private` - Count private commits _(boolean)_
- `line_height` - Sets the line-height between text _(number)_
- `custom_title` - Sets a custom title for the card

#### Repo Card Exclusive Options:

@@ -171,6 +172,7 @@ You can provide multiple comma-separated values in bg_color option to render a g
- `card_width` - Set the card's width manually _(number)_
- `langs_count` - Show more languages on the card, between 1-10, defaults to 5 _(number)_
- `exclude_repo` - Exclude specified repositories _(Comma-separated values)_
- `custom_title` - Sets a custom title for the card

> :warning: **Important:**
> Language names should be uri-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding)
@@ -181,6 +183,7 @@ You can provide multiple comma-separated values in bg_color option to render a g
- `hide_title` - _(boolean)_
- `line_height` - Sets the line-height between text _(number)_
- `hide_progress` - Hides the progress bar and percentage _(boolean)_
- `custom_title` - Sets a custom title for the card

---

Loading