Documentation Index
Fetch the complete documentation index at: https://docs.ghost.org/llms.txt
Use this file to discover all available pages before exploring further.
{{#social_accounts}} is a block helper that iterates over the connected social accounts on a given source object — usually @site or an author. The source must be passed as a positional argument.
Simple Example
Render a row of links for the social accounts configured under Settings > General > Social accounts:Data Variables
When inside a{{#social_accounts}} block, the following properties are available for each account:
- type (string) - the platform key (e.g.
x,bluesky) - href (string) - the full URL to the profile
- username (string) - the raw stored handle or URL fragment
- name (string) - the human-readable platform label (e.g.
X,Facebook)
- @index (number) - the 0-based index of the current iteration
- @number (number) - the 1-based index of the current iteration
- @first (boolean) - true if this is the first iteration
- @last (boolean) - true if this is the last iteration
- @odd (boolean) - true if the @index is odd
- @even (boolean) - true if the @index is even
Usage
Per-author accounts
When used inside{{#foreach authors}}, pass this to iterate the current author’s accounts:
author:
{{else}} and negation
Like all block helpers,{{#social_accounts}} supports an {{else}} block, which is executed when there are no connected accounts:
Using partials
Most themes ship a separate icon partial per platform —partials/icons/x.hbs, partials/icons/facebook.hbs, and so on — and want {{#social_accounts}} to pull in the right one based on {{type}}.
This needs a dynamic partial, and the partial must be invoked using the block form ({{#> …}}…{{/undefined}}):
{{> (concat "icons/" type)}}) looks tempting, but it throws a page error if the named partial doesn’t exist — for example, when a new platform ships before a theme adds the matching icon. gscan rejects the inline form on purpose for this reason. The block form falls back to the inner content instead, so the page keeps rendering.
Note the closing tag must be {{/undefined}}. This looks unusual, but it’s the only form Handlebars accepts when closing a dynamic partial block.
Supported platforms
x, facebook, linkedin, bluesky, threads, mastodon, tiktok, youtube, instagram. Platforms without a value set on the source are skipped.
