Skip to content

Commit 57e94ec

Browse files
authored
Added social_url helper (#572)
ref https://linear.app/ghost/issue/PLG-412/create-template-helpers - Instead of duplicating facebook_url and twitter_url we're creating a new social_url helper that takes a social type and then outputs the right url - It uses the context provided, the expected usage would be {{#if bluesky}} <a class="gh-author-bluesky" href="{{social_url type="bluesky"}}" target="_blank" rel="noopener">{{> icons/bluesky}}</a> {{/if}}
1 parent 634a30b commit 57e94ec

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

lib/specs/canary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const authorHelperDocs = `Find more information about the <code>{{authors}}</cod
1515
const tierDesc = `Ghost now supports multiple tiers and subscriptions. All product and price related helpers have been reworked to account for this.`;
1616

1717
// assign new or overwrite existing knownHelpers, templates, or rules here:
18-
let knownHelpers = ['total_members', 'total_paid_members', 'comment_count', 'comments', 'recommendations', 'readable_url', 'content_api_url', 'content_api_key'];
18+
let knownHelpers = ['total_members', 'total_paid_members', 'comment_count', 'comments', 'recommendations', 'readable_url', 'content_api_url', 'content_api_key', 'social_url'];
1919
let templates = [];
2020
let rules = {
2121
// New rules

test/fixtures/themes/080-helper-usage/v4/invalid/index.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55

66
{{tag.feature_image}}⁠⁠
77

8+
{{social_url type="facebook"}}
9+
810
{{> mypartial}}
911
{{> author}}

test/fixtures/themes/080-helper-usage/v5/valid/index.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33

44
{{tag.feature_image}}⁠⁠
55

6+
{{social_url type="facebook"}}
7+
68
{{> mypartial}}

0 commit comments

Comments
 (0)