eddiesigner / liebling

Beautiful and clean Ghost theme that is easy and comfortable to use. To get the latest version please head over the releases page 👉🏼
https://github.com/eddiesigner/liebling/releases
MIT License
1.27k stars 602 forks source link

Suppress Twitter #358

Closed tomotvos closed 3 years ago

tomotvos commented 3 years ago

Love the theme so far. One issue is that my site does not have a Twitter URL. Would it be a straightforward task to make the Twitter links conditional on that?

eddiesigner commented 3 years ago

To remove the Twitter button you can just clear the url in the Ghost Admin, if the field is empty then the button won't be displayed.

tomotvos commented 3 years ago

Then that is a bug, because it does not happen that way. Looking at the code, I didn't see conditional tests either.

eddiesigner commented 3 years ago

The code looks like this:

{{#if @site.twitter}}
    <a href="{{twitter_url @site.twitter}}" target="_blank" rel="noopener" aria-label="Twitter">
        <span class="icon-twitter" aria-hidden="true"></span>
    </a>
{{/if}}

Please make sure to save your changes.

tomotvos commented 3 years ago

Ok, I see that in footer.hbs, but it is missing from post.hbs. Thanks!

ClassUnwind commented 3 years ago

Just to confirm, you're not talking about removing the "Share" button for Twitter that's on the top(ish) right hand side of the posts, located above the Facebook button, right? That simply links to a preformatted "intent" for Twitter users to post a Tweet where the site's URL are present, not a link to the site's Twitter account as such.

If, however, that's what you would like to remove, then either (a), removing the link in the code, located in post.hbs: https://github.com/eddiesigner/liebling/blob/72b7d15f3d392741236303d1a9f825dd18912be7/post.hbs#L57-L60 Or (b), adding a <style> code injection (located at Settings>Code injection), where the CSS is something like:

<style>
div.m-share > div > a[href^='https://twitter.com/'] { display: none; }
</style>

The site Twitter link code is present in the footer.hbs file linked above, and it will not be output if it isn't set in Settings>General>Social accounts -- ie, left blank. I've verified on my end, running the latest Ghost and Liebling version, that this does work as intended.

There's also the Author who will get a Twitter link added if the corresponding "Staff" member has one set -- but, again, won't be output if not set.

eddiesigner commented 3 years ago

I will close this issue for now, please feel free to reopen it if needed.