Contoh lengkap

profile-graphics.yml
provider:
  type: github
  user: octocat
  include_private: false

charts: [streak, summary, langs, calendar]

output:
  dir: profile-graphics
  format: svg
  layout: separate
  raster_background: auto

calendar:
  mode: rolling
  timezone: Europe/Berlin
  locale: en

theme:
  mode: auto
  native: true
  dark_mode_pair: false

svg:
  frame: border
  frame_radius: 8
  frame_title: ""
  hide_title: false
  number_format: short
  animation: none
  accessibility: true

cards:
  langs:
    style: donut
    count: 6
    exclude: [HTML, CSS]
  summary:
    metrics: [stars, commits, prs, reviews]
  calendar:
    weeks: 52
    show_months: true

Grup opsi

Grup Opsi
provider type, user, token, base_url, source, include_private, include_forks, exclude_repos, affiliations, merge
output dir, prefix, format, layout, columns, raster_background
calendar mode, year, timezone, locale
theme preset, custom, mode, native, dark_mode_pair, background, colors
svg frame, frame_radius, frame_title, hide_title, number_format, animation, animation_duration, accessibility
cards activity, langs, streak, summary, productive_time, punch_card, calendar, calendar_3d, profile_details, profile_card, trophy, repos, coding_time, coding_list, views

charts berisi daftar kartu yang dirender, sesuai urutan itu. Lihat Kartu untuk setiap kartu dan opsinya di bawah cards.

calendar.timezone adalah nama IANA seperti Europe/Berlin (bawaan UTC). Ini menentukan hari milik sebuah event, kapan rentetan berakhir, dan jam mana yang dihitung kartu waktu produktif.

theme.background menerima warna, transparent, atau gradien linear seperti 30,#e96443,#904e95; lihat Latar gradien.

Preset review

review di charts diperluas menjadi summary, streak, calendar, langs, punch-card, dan repos, sesuai urutan itu: tinjauan profil lengkap dalam satu kata. Cantumkan kartu lain sebelum atau sesudahnya; kartu yang muncul dua kali dirender sekali.

yaml
charts: [review, activity]

Flag CLI dan input Action

Sebagian besar opsi bisa diatur tanpa mengedit YAML: berikan sebagai flag CLI atau input GitHub Action. Flag dan input menimpa file konfigurasi. Daftar seperti charts dipisahkan koma. provider.merge, tema kustom, penggantian warna, dan ukuran kartu hanya bisa di YAML.

Path konfigurasi Flag CLI Input Action
provider.type --provider provider
provider.user --user user
provider.token --token token
provider.base_url --base-url base_url
provider.source --source source
provider.include_private --include-private include_private
provider.include_forks --include-forks include_forks
provider.exclude_repos --exclude-repos exclude_repos
provider.affiliations --affiliations affiliations
provider.scope --scope scope
provider.include_orgs --include-orgs include_orgs
provider.exclude_orgs --exclude-orgs exclude_orgs
provider.count_private --count-private count_private
provider.count_own_stars --count-own-stars count_own_stars
charts --charts charts
output.dir --output output
output.prefix --prefix prefix
output.format --format format
output.layout --layout layout
output.columns --dashboard-columns dashboard_columns
output.raster_background --raster-background raster_background
calendar.year --year year
calendar.mode --calendar-mode calendar_mode
calendar.timezone --timezone timezone
calendar.locale --locale locale
theme.preset --theme theme
theme.mode --theme-mode theme_mode
theme.native --native-theme native_theme
theme.dark_mode_pair --dark-mode-pair dark_mode_pair
theme.background --background background
svg.frame --frame frame
svg.frame_radius --frame-radius frame_radius
svg.frame_title --frame-title frame_title
svg.hide_title --hide-title hide_title
svg.animation --animation animation
svg.animation_duration --animation-duration animation_duration
svg.number_format --number-format number_format
svg.accessibility --accessibility accessibility
cards.activity.days --activity-days activity_days
cards.activity.show_grid --activity-grid activity_grid
cards.activity.show_points --activity-points activity_points
cards.activity.show_average --activity-average activity_average
cards.langs.count --langs-count langs_count
cards.langs.style --langs-style langs_style
cards.langs.exclude --langs-exclude langs_exclude
cards.summary.metrics --summary-metrics summary_metrics
cards.streak.mode --streak-mode streak_mode
cards.streak.exclude_days --exclude-days exclude_days
cards.streak.range --streak-range streak_range
cards.summary.show_rank --summary-rank summary_rank
cards.summary.rank_style --rank-style rank_style
cards.punch_card.week_start --week-start week_start
cards.productive_time.hour_format --hour-format hour_format
cards.calendar.weeks --calendar-weeks calendar_weeks
cards.calendar.show_months --calendar-months calendar_months
cards.profile_details.show_chart --profile-chart profile_chart
cards.profile_card.show_avatar --profile-avatar profile_avatar
cards.trophy.columns --trophy-columns trophy_columns
cards.trophy.max --trophy-max trophy_max
cards.repos.source --repos-source repos_source
cards.repos.count --repos-count repos_count
cards.calendar_3d.weeks --calendar-3d-weeks calendar_3d_weeks
cards.coding_time.days --coding-days coding_days
cards.coding_list.count --coding-count coding_count
cards.views.style --views-style views_style
cards.views.label --views-label views_label
cards.views.start --views-start views_start

Jendela kalender

calendar.mode mengatur tanggal yang dicakup setiap kartu. current-year (bawaan) berjalan dari Januari sampai Desember tahun ini, last-year mencakup tahun lalu, dan rolling menampilkan dua belas bulan terakhir sampai hari ini, seperti grafik di profil GitHub. calendar.year memilih satu tahun dan lebih diutamakan daripada mode. Total, rentetan, dan kartu kalender mengikuti jendela, jadi rolling menjaga rentetan tetap hidup melewati pergantian tahun.

yaml
calendar:
  mode: rolling
  # year: 2025 picks one calendar year instead
  timezone: Europe/Berlin

Bahasa kartu

calendar.locale adalah tag BCP 47 (bawaan en-US). Label kartu diterjemahkan ke 30 bahasa (Arab, Ibrani, dan Persia digambar dari kanan ke kiri); locale lain tetap memakai label bahasa Inggris. Angka, tanggal, bulan, hari, dan durasi selalu diformat dengan Intl dalam locale yang kamu atur.

Inggris

Inggris

yaml
calendar:
  locale: en
Rusia

Rusia

yaml
calendar:
  locale: ru
Jerman

Jerman

yaml
calendar:
  locale: de
Spanyol

Spanyol

yaml
calendar:
  locale: es
Prancis

Prancis

yaml
calendar:
  locale: fr
Portugis

Portugis

yaml
calendar:
  locale: pt
Jepang

Jepang

yaml
calendar:
  locale: ja
Tionghoa

Tionghoa

yaml
calendar:
  locale: zh

Pasangan gelap dan terang

Dengan tema otomatis native, setiap SVG sudah beralih antara terang dan gelap lewat prefers-color-scheme. dark_mode_pair: true sebagai gantinya menulis dua file per kartu, misalnya streak-light.svg dan streak-dark.svg, untuk elemen <picture>. Ini hanya berlaku untuk tema otomatis native; preset atau tema kustom menulis satu file per kartu.

yaml
theme:
  mode: auto
  native: true
  dark_mode_pair: true
README.md
<picture>
  <source media="(prefers-color-scheme: dark)" srcset="profile-graphics/streak-dark.svg" />
  <img alt="Streak" src="profile-graphics/streak-light.svg" />
</picture>

Dashboard

output.layout: dashboard menaruh semua kartu dari charts ke dalam satu gambar, dashboard.svg (atau PNG atau WebP), bukan satu file per kartu. output.columns mengatur jumlah kartu per baris, dari 1 sampai 4 (bawaan 2).

yaml
charts: [streak, summary, langs, calendar]

output:
  layout: dashboard
  columns: 2

Bingkai dan judul

svg.frame menentukan apa yang mengelilingi setiap kartu. frame_radius membulatkan sudut (0 sampai 40, bawaan 8).

Garis tepi

Garis tepi

Bawaan: garis tepi tipis berwarna sel kalender kosong.

yaml
svg:
  frame: border
  frame_radius: 8
Jendela

Jendela

Bilah jendela dengan lampu lalu lintas dan judul tengah opsional.

yaml
svg:
  frame: window
  frame_title: "{user}"
Tanpa bingkai

Tanpa bingkai

Hanya latar, untuk kartu yang berada di dalam tata letakmu sendiri.

yaml
svg:
  frame: none

frame_title menambahkan judul di atas kartu (hingga 120 karakter). Placeholder ini diisi dari statistikmu, dengan angka dalam locale kalender:

Placeholder Nilai
{user} Nama pengguna
{name} Nama tampilan, atau nama pengguna jika tidak ada
{year} Tahun jendela kalender
{total} Kontribusi di jendela
{active_days} Hari dengan minimal satu kontribusi
{streak} Rentetan saat ini dalam hari
{longest_streak} Rentetan terpanjang dalam hari
{best_day} Kontribusi terbanyak dalam satu hari
{best_date} Tanggal hari tersebut
{stars} Bintang di repositorimu
{commits} Commit di jendela
{followers} Pengikut
{top_language} Bahasa yang paling sering dipakai

Judul, angka, dan animasi

svg.hide_title: true menyembunyikan judul di setiap kartu yang punya judul. Per kartu, title menggantikan judul dan hide_title menyembunyikannya; lihat Judul kartu.

svg.number_format menentukan cara kartu menulis jumlah: short (bawaan) menyingkatnya dalam locale kartu, misalnya 1.2K, dan long menulisnya lengkap, misalnya 1,247.

svg.animation menambahkan animasi masuk ke kartu SVG: fade memunculkan isinya, dan rise juga mengangkatnya beberapa piksel. animation_duration mengatur durasinya dalam detik (0.2 sampai 5, bawaan 0.8). Pengunjung yang sistemnya meminta gerakan dikurangi melihat kartu tanpa animasi, dan file PNG serta WebP tidak pernah bergerak. Bawaannya none.

yaml
svg:
  hide_title: true
  number_format: long
  animation: rise
  animation_duration: 0.8

Berbagi satu konfigurasi dengan profile-snake

extends menunjuk ke file YAML atau JSON lain, relatif terhadap file saat ini. File itu dibaca lebih dulu dan file saat ini digabung di atasnya: bagian bersarang digabung per kunci, daftar dan nilai diganti. Simpan provider, calendar, dan theme bersama di satu profile.yml dan perluas dari profile-graphics.yml maupun profile-snake.yml.

profile.yml
provider:
  user: octocat
calendar:
  mode: rolling
  timezone: Europe/Berlin
theme:
  preset: tokyo-night
profile-graphics.yml
extends: ./profile.yml
charts: [streak, summary, langs]

Kunci yang tidak dikenal satu alat, seperti snake atau charts, diabaikan oleh alat lainnya. Hingga 8 berkas dapat saling memperluas; siklus atau berkas yang hilang berhenti dengan kesalahan konfigurasi. Playground dan komponen web membaca satu konfigurasi dan tidak mengikuti extends.

Dukungan editor

Tambahkan baris ini di awal file untuk mendapatkan pelengkapan dan validasi di editor yang memahami YAML language server; profile-graphics init menuliskannya untukmu. profile-graphics schema mencetak path skema yang disertakan dalam paket.

yaml
# yaml-language-server: $schema=https://unpkg.com/profile-graphics/profile-graphics.schema.json
provider:
  user: octocat