Developers · Gutenberg

GitHub Card block for WordPress

Display a GitHub user profile or repository card with live stats fetched from the GitHub API.

Get Blockenberg

Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.

Get Blockenberg

What it actually does

Display a GitHub user profile or repository card with live stats fetched from the GitHub API.

Inspector panels on this block: GitHub Source, Display, Layout. Those titles come from index.js, not from a shared template.

Behavior controls: “Card Type” options: Repository, User Profile; “Repository Name” (Just the repo name, not the full URL); “Cache Duration (minutes)” (Stores API response in localStorage to avoid rate limits); “Layout — Alignment” options: Left, Center, Right.

Where to find it

Gutenberg inserter → Developers → search “GitHub Card” (block name `blockenberg/github-card` in block.json). Style it in the sidebar after insert.

How to use GitHub Card block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “GitHub Card”, insert it. Category: Developers.
  3. Configure inspector controls that exist on this block. Open GitHub Source. Set “Card Type”, “GitHub Username”, “Repository Name”, “Cache Duration (minutes)”.
  4. Check the published page. The view script reads HTML data attributes: data-lang, data-opts. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Card TypeSelect control; the chosen value is saved on the block. Options: Repository; User Profile. block.json default: repo. Saved as `mode`.
GitHub UsernameText field in the inspector. Saved as `username`.
Repository NameText field in the inspector. Just the repo name, not the full URL. Saved as `repoName`.
Cache Duration (minutes)Numeric range control in the inspector. Stores API response in localStorage to avoid rate limits. Range 5–1440. block.json default: 60. Saved as `cacheMinutes`.
Open Links in New TabOn/off toggle in the inspector. On by default. Saved as `openInNewTab`.
Show AvatarOn/off toggle in the inspector. On by default. Saved as `showAvatar`.
Show Bio / DescriptionOn/off toggle in the inspector. On by default. Saved as `showBio`.
Show StatsOn/off toggle in the inspector. On by default. Saved as `showStats`.
Show LanguageOn/off toggle in the inspector. On by default. Saved as `showLanguage`.
Show TopicsOn/off toggle in the inspector. On by default. Saved as `showTopics`.
Show Last UpdatedOn/off toggle in the inspector. On by default. Saved as `showLastUpdate`.
Layout — AlignmentSelect control; the chosen value is saved on the block. Options: Left; Center; Right. block.json default: center. Saved as `align2`.
Max Width (px)Numeric range control in the inspector. Range 280–800. block.json default: 480. Saved as `maxWidth`.
Padding (px)Numeric range control in the inspector. Range 12–48. block.json default: 24. Saved as `padding`.
Corner Radius (px)Numeric range control in the inspector. Range 0–32. block.json default: 16. Saved as `cardRadius`.
Avatar Size (px)Numeric range control in the inspector. Range 32–120. block.json default: 64. Saved as `avatarSize`.
Card BackgroundColor control in the inspector. block.json default: #0d1117. Saved as `cardBg`.
Heading / NameColor control in the inspector. block.json default: #e6edf3. Saved as `headingColor`.
DescriptionColor control in the inspector. block.json default: #8b949e. Saved as `descColor`.
Meta / Stats LabelColor control in the inspector. block.json default: #8b949e. Saved as `metaColor`.
Link / AccentColor control in the inspector. block.json default: #58a6ff. Saved as `linkColor`.
Stat Tile BackgroundColor control in the inspector. block.json default: #161b22. Saved as `statBg`.
Colors — BorderColor control in the inspector. block.json default: #30363d. Saved as `borderColor`.
Section BackgroundColor control in the inspector. Saved as `sectionBg`.

What the front-end script actually does

When this is the right block

Notes from the implementation

viewScript: this folder’s frontend.js is enqueued on the front end for this block.

FAQ

How do I add the GitHub Card block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “GitHub Card”. It sits under Developers. After insert, open GitHub Source and set “Card Type”, “GitHub Username”, “Repository Name”, “Cache Duration (minutes)”.

Where does GitHub Card store visitor state?

In localStorage on that browser. Clearing site data resets it. It is not a WordPress user meta field unless render.php says so.

Is the GitHub Card Gutenberg block free?

Yes. GitHub Card ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style GitHub Card to match my theme?

Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: GitHub Source, Display, Layout).

Related developers blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert GitHub Card from the Gutenberg inserter.

Get Blockenberg