Skip to content

Commit fb44e80

Browse files
Added site-wide social links support (#515)
1 parent b42d16b commit fb44e80

9 files changed

Lines changed: 26 additions & 16 deletions

File tree

assets/built/screen.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/built/screen.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/css/blog/share.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
background-color: var(--facebook-color);
3333
}
3434

35-
.share-link-twitter {
35+
.share-link-x {
3636
background-color: var(--twitter-color);
3737
}
3838

assets/css/misc/dark.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
color: var(--facebook-color);
4242
}
4343

44-
.theme-dark .share-link-twitter {
44+
.theme-dark .share-link-x {
4545
color: var(--twitter-color);
4646
}
4747

@@ -130,7 +130,7 @@
130130
color: var(--facebook-color);
131131
}
132132

133-
html:not(.theme-light) .share-link-twitter {
133+
html:not(.theme-light) .share-link-x {
134134
color: var(--twitter-color);
135135
}
136136

author.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
</a>
3232
{{/if}}
3333
{{#if twitter}}
34-
<a class="share-link share-link-twitter author-social-item" href="{{social_url type="twitter"}}" target="_blank" rel="noopener noreferrer">
35-
{{> "icons/twitter"}}
34+
<a class="share-link share-link-x author-social-item" href="{{social_url type="twitter"}}" target="_blank" rel="noopener noreferrer">
35+
{{> "icons/x"}}
3636
Twitter
3737
</a>
3838
{{/if}}

default.hbs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,23 @@
8282
<div class="gh-copyright">
8383
{{@site.title}} © {{date format="YYYY"}}
8484
</div>
85-
{{#if @site.secondary_navigation}}
86-
<nav class="gh-foot-menu">
87-
{{navigation type="secondary"}}
88-
</nav>
89-
{{/if}}
85+
<div class="gh-foot-center">
86+
<div class="gh-social-links">
87+
{{#social_accounts @site}}
88+
<a href="{{href}}" target="_blank" rel="noopener" aria-label="{{name}}">
89+
{{#> (concat "icons/" type)}}
90+
{{!-- Fallback when no per-platform icon partial exists --}}
91+
<span>{{name}}</span>
92+
{{/undefined}}
93+
</a>
94+
{{/social_accounts}}
95+
</div>
96+
{{#if @site.secondary_navigation}}
97+
<nav class="gh-foot-menu">
98+
{{navigation type="secondary"}}
99+
</nav>
100+
{{/if}}
101+
</div>
90102
<div class="gh-powered-by">
91103
{{{t "Powered by {ghostlink}" ghostlink="<a href=\"https://ghost.org/\" target=\"_blank\" rel=\"noopener\">Ghost</a>"}}}
92104
</div>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"zip": "gulp zip"
104104
},
105105
"devDependencies": {
106-
"@tryghost/shared-theme-assets": "2.6.1",
106+
"@tryghost/shared-theme-assets": "2.7.1",
107107
"@tryghost/theme-translations": "^0.0.9",
108108
"autoprefixer": "10.5.0",
109109
"beeper": "2.1.0",

partials/icons/twitter.hbs

Lines changed: 0 additions & 3 deletions
This file was deleted.

partials/icons/x.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<svg viewBox="0 0 24 24" fill="currentColor"><g><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"></path></g></svg>

0 commit comments

Comments
 (0)