Skip to content

Document {{#social_accounts}} block helper#62

Open
ErisDS wants to merge 2 commits into
mainfrom
docs/social-accounts-helper
Open

Document {{#social_accounts}} block helper#62
ErisDS wants to merge 2 commits into
mainfrom
docs/social-accounts-helper

Conversation

@ErisDS
Copy link
Copy Markdown
Member

@ErisDS ErisDS commented May 13, 2026

Summary

Documents the new {{#social_accounts}} block helper (added in TryGhost/Ghost#27834 and now shipped). The helper iterates the connected social accounts on a given source object — typically @site or an author — replacing ~27 lines of repetitive {{#if twitter}}…{{#if facebook}}… blocks in theme templates with a single iterator, while keeping themes in full control of markup, classes, and icon partials.

{{#social_accounts @site}}
    <a href="{{href}}" target="_blank" rel="noopener" aria-label="{{name}}">
        {{> (concat "icons/" type)}}
    </a>
{{/social_accounts}}

Changes

  • themes/helpers/data/social_accounts.mdx — New page. Covers the explicit-source design, four usage examples (@site, inside {{#foreach authors}}, on author pages, with {{else}}), the per-iteration attributes (type, href, username, name), the supported platform list, and a short rationale for why the source must be explicit.
  • themes/helpers/data.mdx — Adds a row for social_accounts to the data helpers index table, immediately above social_url.
  • docs.json — Adds the new page to the Data helpers nav, alphabetised next to social_url.
  • themes/helpers/data/social_url.mdx — Adds a one-line cross-link pointing readers at {{#social_accounts}} for the "render all connected platforms at once" use case. (Held back from Fix social_url helper fallback documentation #61 to avoid an in-flight conflict; included here now that Fix social_url helper fallback documentation #61 has merged.)

Companion / related

@mintlify
Copy link
Copy Markdown
Contributor

mintlify Bot commented May 13, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Ghost 🟢 Ready View Preview May 13, 2026, 10:15 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5a494d3b-6585-41b2-bcaf-7568718ac2af

📥 Commits

Reviewing files that changed from the base of the PR and between 1244668 and dd5209b.

📒 Files selected for processing (1)
  • themes/helpers/data/social_accounts.mdx

Walkthrough

Adds a new MDX reference page for the {{#social_accounts}} block helper (frontmatter, description, per-iteration variables, iteration frame variables, usage examples for sitewide and author contexts, else behavior, and supported platforms). Updates the Data Helpers reference table to include a social_accounts row and inserts the new route into docs navigation. Adds a cross-reference from the social_url helper page to the social_accounts helper.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • TryGhost/Docs#61: Updates social_url helper documentation and is directly related to the cross-reference added to social_accounts.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: documenting the new {{#social_accounts}} block helper, which is the primary focus of all changes in the PR.
Description check ✅ Passed The description provides detailed context about the new helper, explains the changes made, includes usage examples, and references related work. It is comprehensive and directly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/social-accounts-helper

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@themes/helpers/data/social_url.mdx`:
- Line 15: The PR added a cross-link mentioning `{{`#social_accounts`}}` but the
PR objectives stated that this link should be deferred to avoid conflict with PR
`#61`; either remove the new cross-link sentence referencing `social_accounts`
from the content or update the PR objective/note to state that the
`social_accounts` cross-link will be included now, ensuring the change in intent
is reflected in the PR description and release notes; locate the added text that
contains `{{`#social_accounts`}}` and either delete that sentence or rewrite the
PR metadata to match the new plan.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 16042669-7d5c-4c0a-a48c-2d759c3db303

📥 Commits

Reviewing files that changed from the base of the PR and between 0e3674a and c979233.

📒 Files selected for processing (4)
  • docs.json
  • themes/helpers/data.mdx
  • themes/helpers/data/social_accounts.mdx
  • themes/helpers/data/social_url.mdx

Comment thread themes/helpers/data/social_url.mdx
New block iterator helper added in TryGhost/Ghost#27834. It yields each connected social account on a given source object (@site or author), replacing repetitive {{#if twitter}}…{{#if facebook}}… chains in themes. Per-iteration it exposes {type, href, username, name} so themes keep full control of markup. Adds the new page under Data helpers, links it from the index table, and slots it into the docs.json nav next to {{social_url}}.
The helper emits {{type}}: "x" for the X/Twitter platform (matching the admin UI label and theme partial conventions); the docs were referencing the legacy storage key. See TryGhost/Ghost#27871.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant