Ví dụ đầy đủ

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

Nhóm tùy chọn

Nhóm Tùy chọn
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 liệt kê các thẻ cần vẽ, theo đúng thứ tự đó. Xem Thẻ để biết từng thẻ và tùy chọn của nó trong cards.

calendar.timezone là một tên IANA như Europe/Berlin (mặc định UTC). Nó quyết định một sự kiện thuộc ngày nào, khi nào chuỗi kết thúc và thẻ giờ năng suất đếm giờ nào.

theme.background nhận một màu, transparent hoặc một dải màu tuyến tính như 30,#e96443,#904e95; xem Nền dải màu.

Preset review

review trong charts mở rộng thành summary, streak, calendar, langs, punch-card và repos, theo đúng thứ tự: đánh giá toàn bộ hồ sơ trong một từ. Liệt kê thẻ khác trước hoặc sau nó; thẻ xuất hiện hai lần chỉ được vẽ một lần.

yaml
charts: [review, activity]

Cờ CLI và đầu vào Action

Hầu hết tùy chọn đặt được mà không cần sửa YAML: truyền chúng dưới dạng cờ CLI hoặc đầu vào của GitHub Action. Cờ và đầu vào ghi đè tệp cấu hình. Danh sách như charts phân tách bằng dấu phẩy. provider.merge, giao diện tùy chỉnh, ghi đè màu và kích thước thẻ chỉ đặt được trong YAML.

Đường dẫn cấu hình Cờ CLI Đầu vào 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

Khung lịch

calendar.mode đặt các ngày mà mọi thẻ bao phủ. current-year (mặc định) chạy từ tháng Một đến tháng Mười hai năm nay, last-year bao phủ năm trước, và rolling hiện mười hai tháng gần nhất tới hôm nay, giống biểu đồ trên hồ sơ GitHub. calendar.year chọn một năm và được ưu tiên hơn chế độ. Tổng số, chuỗi và thẻ lịch theo khung này, nên rolling giữ chuỗi qua năm mới.

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

Ngôn ngữ thẻ

calendar.locale là một thẻ BCP 47 (mặc định en-US). Nhãn thẻ được dịch sang 30 ngôn ngữ (tiếng Ả Rập, tiếng Do Thái và tiếng Ba Tư được vẽ từ phải sang trái); mọi locale khác giữ nhãn tiếng Anh. Số, ngày, tháng, ngày trong tuần và khoảng thời gian luôn được định dạng bằng Intl theo locale bạn đặt.

Tiếng Anh

Tiếng Anh

yaml
calendar:
  locale: en
Tiếng Nga

Tiếng Nga

yaml
calendar:
  locale: ru
Tiếng Đức

Tiếng Đức

yaml
calendar:
  locale: de
Tiếng Tây Ban Nha

Tiếng Tây Ban Nha

yaml
calendar:
  locale: es
Tiếng Pháp

Tiếng Pháp

yaml
calendar:
  locale: fr
Tiếng Bồ Đào Nha

Tiếng Bồ Đào Nha

yaml
calendar:
  locale: pt
Tiếng Nhật

Tiếng Nhật

yaml
calendar:
  locale: ja
Tiếng Trung

Tiếng Trung

yaml
calendar:
  locale: zh

Cặp tối và sáng

Với giao diện tự động gốc, mọi SVG đã tự chuyển giữa sáng và tối qua prefers-color-scheme. dark_mode_pair: true thay vào đó ghi hai tệp cho mỗi thẻ, như streak-light.svg và streak-dark.svg, cho phần tử <picture>. Điều này chỉ áp dụng cho giao diện tự động gốc; giao diện dựng sẵn hoặc tùy chỉnh ghi một tệp cho mỗi thẻ.

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>

Bảng điều khiển

output.layout: dashboard đặt mọi thẻ trong charts vào một ảnh, dashboard.svg (hoặc PNG hay WebP), thay vì mỗi thẻ một tệp. output.columns đặt số thẻ trên một hàng, từ 1 đến 4 (mặc định 2).

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

output:
  layout: dashboard
  columns: 2

Khung và tiêu đề

svg.frame quyết định thứ bao quanh mỗi thẻ. frame_radius bo tròn góc (0 đến 40, mặc định 8).

Viền

Viền

Mặc định: một đường viền mảnh cùng màu với ô lịch trống.

yaml
svg:
  frame: border
  frame_radius: 8
Cửa sổ

Cửa sổ

Thanh cửa sổ có đèn giao thông và tiêu đề căn giữa tùy chọn.

yaml
svg:
  frame: window
  frame_title: "{user}"
Không khung

Không khung

Chỉ có nền, cho thẻ nằm trong bố cục của riêng bạn.

yaml
svg:
  frame: none

frame_title thêm tiêu đề phía trên thẻ (tối đa 120 ký tự). Các chỗ giữ chỗ này được điền từ thống kê của bạn, với số theo locale của lịch:

Chỗ giữ chỗ Giá trị
{user} Tên người dùng
{name} Tên hiển thị, hoặc tên người dùng nếu không có
{year} Năm của khung lịch
{total} Đóng góp trong khung
{active_days} Số ngày có ít nhất một đóng góp
{streak} Chuỗi hiện tại tính bằng ngày
{longest_streak} Chuỗi dài nhất tính bằng ngày
{best_day} Nhiều đóng góp nhất trong một ngày
{best_date} Ngày của hôm đó
{stars} Số sao trên các kho mã của bạn
{commits} Commit trong khung
{followers} Người theo dõi
{top_language} Ngôn ngữ dùng nhiều nhất

Tiêu đề, số và hoạt ảnh

svg.hide_title: true ẩn tiêu đề trên mọi thẻ có tiêu đề. Với từng thẻ, title thay tiêu đề và hide_title ẩn nó; xem Tiêu đề thẻ.

svg.number_format quyết định cách thẻ ghi số: short (mặc định) rút gọn theo ngôn ngữ của thẻ, như 1.2K, còn long ghi đầy đủ, như 1,247.

svg.animation thêm hoạt ảnh xuất hiện cho thẻ SVG: fade làm nội dung hiện dần, còn rise nâng nó lên thêm vài pixel. animation_duration đặt độ dài tính bằng giây (0,2 đến 5, mặc định 0,8). Người xem có hệ thống yêu cầu giảm chuyển động sẽ thấy thẻ không có hoạt ảnh, và tệp PNG và WebP không bao giờ chuyển động. Mặc định là none.

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

Dùng chung cấu hình với profile-snake

extends trỏ tới một tệp YAML hoặc JSON khác, tương đối so với tệp hiện tại. Tệp đó được đọc trước và tệp hiện tại được gộp lên trên: các phần lồng nhau gộp theo từng khóa, danh sách và giá trị bị thay thế. Giữ provider, calendar và theme dùng chung trong một profile.yml và mở rộng nó từ cả profile-graphics.yml lẫn 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]

Các khóa mà một công cụ không biết, như snake hay charts, sẽ bị công cụ kia bỏ qua. Tối đa 8 tệp có thể mở rộng lẫn nhau; vòng lặp hoặc tệp bị thiếu sẽ dừng với lỗi cấu hình. Playground và web component đọc một cấu hình duy nhất và không theo extends.

Hỗ trợ trình soạn thảo

Thêm dòng này ở đầu tệp để có gợi ý và xác thực trong các trình soạn thảo hiểu YAML language server; profile-graphics init ghi sẵn cho bạn. profile-graphics schema in đường dẫn của schema đi kèm gói.

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