Skip to main content

Documentation Index

Fetch the complete documentation index at: https://ghost-docs-social-accounts-helper.mintlify.app/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 icons for the social accounts configured under Settings > General > Social accounts:
{{#social_accounts @site}}
<a href="{{href}}" target="_blank" rel="noopener" aria-label="{{name}}">
  {{> (concat "icons/" type)}}
</a>
{{/social_accounts}}

Data Variables

When inside a {{#social_accounts}} block, the following properties are available for each account:
  • type (string) - the storage key (e.g. twitter, 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)
The standard iteration variables are also available:
  • @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:
{{#foreach authors}}
<h3>{{name}}</h3>
{{#social_accounts this}}
  <a href="{{href}}" aria-label="{{name}}">{{> (concat "icons/" type)}}</a>
{{/social_accounts}}
{{/foreach}}
On an author page, the author is named author:
{{#social_accounts author}}
<a href="{{href}}" aria-label="{{name}}">{{> (concat "icons/" type)}}</a>
{{/social_accounts}}

{{else}} and negation

Like all block helpers, {{#social_accounts}} supports an {{else}} block, which is executed when there are no connected accounts:
{{#social_accounts @site}}
<a href="{{href}}">{{name}}</a>
{{else}}
<p>No social accounts connected yet.</p>
{{/social_accounts}}

Supported platforms

twitter, facebook, linkedin, bluesky, threads, mastodon, tiktok, youtube, instagram. Platforms without a value set on the source are skipped.