-1

Social media sharing of blog posts is, by definition, done within the individual blog post view.

Each social media site has unique javascript to be called when the their share icon is clicked. Upon execution, a social media-specific window will appear: a) previewing the to-be-shared content (including a YAML-specified image, and YAML-specified text summary); b) prompt the user for share parameters; and c) complete the share. The shared blog post will appear in the user's social media feed, with an embedded link back to the originating blog post, and be seen by the user's social media followers/connections/friends. (A viral effect may ensue; its not uncommon for popular posts to reach millions of social media users, in turn generating substantial traffic on the blog site.)

Social media sites of interest are Twitter, LinkedIn, and Facebook.

How would I go about implementing this social media sharing functionality in blogdown's default theme (hugo-lithium)? I.e., what config.toml to add, where to add social media javascript.

John Williams
  • 75
  • 1
  • 1
  • 8

1 Answers1

2

I don't think Lithium has the necessary functionality. You could of course write it in, but it is much easier to start with a theme that supports it out of the box.
I suggest ghostwiter - blogdown::new_site(theme = "jbub/ghostwriter").
It is simple, clean, and its [Params] section supports various sharing options.

Jindra Lacko
  • 7,814
  • 3
  • 22
  • 44
  • Thanks Jindra! I see in the Ghostwriter demo that it has Twitter and Facebook per-post sharing - thats a great start. Also need LinkedIn per-post sharing. Plus, need a YAML-specified image included in the share content, as text-only shares get little social media attention. Wondering if possible/how I would modify the Ghostwriter theme to include these capabilities? (Also seek to add a template for taxonomies for category/ tag filtering of blog posts). Feature request made on https://github.com/jbub/ghostwriter/issues – John Williams Sep 18 '17 at 20:55
  • 1
    Ghostwriter supports both linkedin *and* image sharing (see linkedin and opengraph section of params). – Jindra Lacko Sep 18 '17 at 21:01
  • 1
    Or have a look on my pages, built on ghostwriter with some (very little) modifications: http://www.jla-data.net (online) or https://github.com/jlacko/JLABlog (source; integrated on s3 via Travis) – Jindra Lacko Sep 18 '17 at 21:04
  • Hi @jlacko, How did you configure Ghostwriter for the social icons (in place of bars next to title), and remove the "GETTING STARTED WITH HUGO" menu item? Thanks in advance! – John Williams Sep 20 '17 at 01:16
  • Hi Jindra, regarding OpenGraph functionality on your "JLA Data" blog when sharing your "Czech Oil Price" post , the "Oil Price in the Czech Republic" image appears in the LinkedIn post, but not in a Tweet or Facebook post. Wondering how to configure my Ghostwriter blog to share images on social media ... thanks for your advice! – John Williams Sep 20 '17 at 05:33
  • 1
    To get rid of 'getting started with hugo' and the 'hugo is for lovers' (or whatever they are called) just delete the markdown files - I believe they are in content directory. Displaying social icons is set in [Params] section of config.toml - you can check mine on the github link. – Jindra Lacko Sep 20 '17 at 05:46
  • 1
    As for the image in link - linkedin and facebook seem to work fine, but twitter needs more love. Thanks for pointing it out (my site is still very fresh, as you no doubt noticed). I do not have a solution yet, but I will look into it – Jindra Lacko Sep 20 '17 at 05:55
  • Hi Jindra, blog is published https://painter-resource-65644.netlify.com/ , trying to figure out the image share with Twitter & LinkedIN (facebook doesn't share at all). unlike your image share (Czech Oil Price visual), my image to share is a .png file displayed at top of blog post. https://github.com/johnbwilliams/openemr-ghost-blog Thanks for your advice! – John Williams Sep 21 '17 at 00:34