الإعدادات
الملف profile-graphics.yml اختياري، لكنه أفضل طريقة لإبقاء البطاقات قابلة للتكرار في CI.
مثال كامل
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
مجموعات الخيارات
| المجموعة | الخيارات |
|---|---|
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 البطاقات المراد عرضها بهذا الترتيب. راجع البطاقات لكل بطاقة وخياراتها تحت cards.
calendar.timezone اسم IANA مثل Europe/Berlin (الافتراضي UTC). يحدد إلى أي يوم ينتمي الحدث، ومتى تنتهي السلسلة، وأي ساعة تحسبها بطاقة الوقت المنتج.
يقبل theme.background لونًا أو transparent أو تدرجًا خطيًا مثل 30,#e96443,#904e95؛ راجع خلفية متدرجة.
إعداد review المسبق
يتوسّع review في charts إلى summary وstreak وcalendar وlangs وpunch-card وrepos بهذا الترتيب: مراجعة كاملة للملف الشخصي بكلمة واحدة. اسرد بطاقات أخرى قبله أو بعده؛ والبطاقة التي تظهر مرتين تُعرض مرة واحدة.
charts: [review, activity]
أعلام CLI ومدخلات Action
يمكن ضبط معظم الخيارات دون تحرير YAML: مرّرها كأعلام CLI أو كمدخلات GitHub Action. تتقدّم الأعلام والمدخلات على ملف الإعدادات. القوائم مثل charts مفصولة بفواصل. أما provider.merge والسمات المخصصة وتجاوزات الألوان وأحجام البطاقات فلا تُضبط إلا في YAML.
| مسار الإعداد | علم CLI | مُدخل 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
|
نافذة التقويم
يحدد calendar.mode التواريخ التي تغطيها كل بطاقة. يمتد current-year (الافتراضي) من يناير إلى ديسمبر من هذه السنة، ويغطي last-year السنة السابقة، ويعرض rolling آخر اثني عشر شهرًا حتى اليوم، مثل الرسم في ملف GitHub الشخصي. يختار calendar.year سنة واحدة ويتقدّم على الوضع. تتبع الإجماليات والسلاسل وبطاقة التقويم النافذة، لذا يُبقي rolling السلسلة حيّة عبر رأس السنة.
calendar:
mode: rolling
# year: 2025 picks one calendar year instead
timezone: Europe/Berlin
لغة البطاقات
calendar.locale وسم BCP 47 (الافتراضي en-US). تسميات البطاقات مترجمة إلى 30 لغة (تُرسم العربية والعبرية والفارسية من اليمين إلى اليسار)؛ وتُبقي أي لغة أخرى التسميات الإنجليزية. تُنسَّق الأرقام والتواريخ والأشهر وأيام الأسبوع والمدد دائمًا بواسطة Intl باللغة التي تحددها.
الإنجليزية
calendar:
locale: en
الروسية
calendar:
locale: ru
الألمانية
calendar:
locale: de
الإسبانية
calendar:
locale: es
الفرنسية
calendar:
locale: fr
البرتغالية
calendar:
locale: pt
اليابانية
calendar:
locale: ja
الصينية
calendar:
locale: zh
زوج داكن وفاتح
مع السمة التلقائية الأصلية يتبدّل كل SVG أصلًا بين الفاتح والداكن عبر prefers-color-scheme. أما dark_mode_pair: true فيكتب بدلًا من ذلك ملفين لكل بطاقة، مثل streak-light.svg وstreak-dark.svg، لعنصر <picture>. ينطبق ذلك على السمة التلقائية الأصلية فقط؛ فالسمة الجاهزة أو المخصصة تكتب ملفًا واحدًا لكل بطاقة.
theme:
mode: auto
native: true
dark_mode_pair: true
<picture>
<source media="(prefers-color-scheme: dark)" srcset="profile-graphics/streak-dark.svg" />
<img alt="Streak" src="profile-graphics/streak-light.svg" />
</picture>
لوحة المعلومات
يضع output.layout: dashboard كل بطاقات charts في صورة واحدة، dashboard.svg (أو PNG أو WebP)، بدل ملف لكل بطاقة. يحدد output.columns عدد البطاقات في كل صف، من 1 إلى 4 (الافتراضي 2).
charts: [streak, summary, langs, calendar]
output:
layout: dashboard
columns: 2
الإطارات والعناوين
يحدد svg.frame ما يحيط بكل بطاقة. يدوّر frame_radius الزوايا (من 0 إلى 40، والافتراضي 8).
حد
الافتراضي: حد رفيع بلون خلايا التقويم الفارغة.
svg:
frame: border
frame_radius: 8
نافذة
شريط نافذة بأزرار ملوّنة وعنوان وسطي اختياري.
svg:
frame: window
frame_title: "{user}"
بلا إطار
الخلفية فقط، للبطاقات التي توضع داخل تخطيطك الخاص.
svg:
frame: none
يضيف frame_title عنوانًا فوق البطاقة (حتى 120 حرفًا). تُملأ هذه العناصر النائبة من إحصاءاتك، مع الأرقام بلغة التقويم:
| العنصر النائب | القيمة |
|---|---|
{user}
| اسم المستخدم |
{name}
| الاسم المعروض، أو اسم المستخدم إن لم يوجد |
{year}
| سنة نافذة التقويم |
{total}
| المساهمات في النافذة |
{active_days}
| الأيام التي فيها مساهمة واحدة على الأقل |
{streak}
| السلسلة الحالية بالأيام |
{longest_streak}
| أطول سلسلة بالأيام |
{best_day}
| أكبر عدد من المساهمات في يوم واحد |
{best_date}
| تاريخ ذلك اليوم |
{stars}
| النجوم على مستودعاتك |
{commits}
| الإيداعات في النافذة |
{followers}
| المتابعون |
{top_language}
| اللغة الأكثر استخدامًا |
العناوين والأرقام والحركة
يُخفي svg.hide_title: true العنوان في كل بطاقة لها عنوان. لكل بطاقة على حدة، يستبدل title العنوان ويُخفيه hide_title؛ راجع عناوين البطاقات.
يحدد svg.number_format كيف تكتب البطاقات الأعداد: short (الافتراضي) يختصرها بلغة البطاقة، مثل 1.2K، وlong يكتبها كاملة، مثل 1,247.
يضيف svg.animation حركة ظهور لبطاقات SVG: fade يُظهر المحتوى تدريجيًا، وrise يرفعه أيضًا ببضع بكسلات. يحدد animation_duration مدتها بالثواني (من 0.2 إلى 5، والافتراضي 0.8). يرى الزوار الذين يطلب نظامهم تقليل الحركة البطاقة من دونها، ولا تتحرك ملفات PNG وWebP أبدًا. الافتراضي none.
svg:
hide_title: true
number_format: long
animation: rise
animation_duration: 0.8
مشاركة الإعدادات مع profile-snake
يشير extends إلى ملف YAML أو JSON آخر، نسبةً إلى الملف الحالي. يُقرأ أولًا ثم يُدمج الملف الحالي فوقه: تُدمج الأقسام المتداخلة مفتاحًا بمفتاح، وتُستبدل القوائم والقيم. احتفظ بـ provider وcalendar وtheme المشتركة في ملف profile.yml واحد ووسّعه من كل من profile-graphics.yml وprofile-snake.yml.
provider:
user: octocat
calendar:
mode: rolling
timezone: Europe/Berlin
theme:
preset: tokyo-night
extends: ./profile.yml
charts: [streak, summary, langs]
المفاتيح التي لا تعرفها إحدى الأداتين، مثل snake أو charts، تتجاهلها الأخرى. يمكن لما يصل إلى 8 ملفات أن يوسّع بعضها بعضًا؛ وتتوقف الحلقة أو الملف المفقود بخطأ إعدادات. يقرأ الملعب ومكوّن الويب إعدادات واحدة ولا يتّبعان extends.
دعم المحررات
أضف هذا السطر في أعلى الملف لتحصل على الإكمال والتحقق في المحررات التي تفهم YAML language server؛ ويكتبه profile-graphics init لك. يطبع profile-graphics schema مسار المخطط المرفق بالحزمة.
# yaml-language-server: $schema=https://unpkg.com/profile-graphics/profile-graphics.schema.json
provider:
user: octocat