This is an experiment how to improve the apearance of GitHub repoository on social media, like Twitter, Facebook and LinkedIn.


Comparison before and after improvement

media repository itself GitHub Page

Problems at sharing a GitHub repository on social media

Even if you want to display the application’s logo when social media sharing, your account profile image (often is a face picture) is used as og:image. Your face is also stretched in LinkedIn. This is not good looking.

A message is appended on twitter: “Contribute to <repository-name> development by creating an account on GitHub”. I think this message is nice, but may not suitable on situation such that portrait list.

How to improve the appearance of social media

The solution is to create an application website using the appropriate ogp tag and use it for sharing on social media. This is easy with the GitHub Pages.

Required steps:

  1. create some markdown file for website, or reuse
  2. create a logo image (height: 630 / width: 1200 seems to be the best)
  3. create _config.yml for jekyll configuration
  4. publish these with GitHub Pages
  5. finally, use the url of GitHub Page for sharing on social media.

The contents of _config.yml are like this.

theme: jekyll-theme-cayman
  username: set0gut1
  - scope:
      path: ""
        path: /img/logo.jpg
        height: 630
        width: 1200