Skip to content

Commit

Permalink
Merge pull request #910 from choldgraf/social_img_tweaks
Browse files Browse the repository at this point in the history
tweaks to social images
  • Loading branch information
betatim authored Jul 30, 2019
2 parents 8bfb783 + e7748ad commit 654b31d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
9 changes: 9 additions & 0 deletions binderhub/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@

from .base import BaseHandler

SPEC_NAMES = {
"gh": "GitHub repository",
"gist": "GitHub Gist",
"gl": "GitLab repository",
"git": "Git repository: ",
"zenodo": "Zenodo DOI"
}

class MainHandler(BaseHandler):
"""Main handler for requests"""
Expand Down Expand Up @@ -46,6 +53,7 @@ def get(self, provider_prefix, _unescaped_spec):
raise HTTPError(400, str(e))

provider_spec = f'{provider_prefix}/{spec}'
social_desc = f"{SPEC_NAMES[provider_prefix]}: {spec}"
nbviewer_url = None
if provider_prefix == "gh":
# we can only produce an nbviewer URL for github right now
Expand All @@ -60,6 +68,7 @@ def get(self, provider_prefix, _unescaped_spec):
base_url=self.settings['base_url'],
badge_base_url=self.settings['badge_base_url'],
provider_spec=provider_spec,
social_desc=social_desc,
nbviewer_url=nbviewer_url,
# urlpath=self.get_argument('urlpath', None),
submit=True,
Expand Down
Binary file modified binderhub/static/images/logo_social.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions binderhub/templates/about.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{% extends "page.html" %}

{% block head %}
<meta property="og:description" content="Reproducible, sharable, open, interactive computing environments.">
{{ super() }}
{% endblock head %}

{% block main %}
<div id="main" class="container">
Expand Down
3 changes: 3 additions & 0 deletions binderhub/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<meta id="base-url" data-url="{{base_url}}">
<meta id="badge-base-url" data-url="{{badge_base_url}}">
<script src="{{static_url("dist/bundle.js")}}"></script>
<!-- Other OG information in page.html -->
<meta property="og:description" content="Reproducible, sharable, interactive computing environments.">

{{ super() }}
{% endblock head %}

Expand Down
3 changes: 3 additions & 0 deletions binderhub/templates/loading.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
{% block head %}
<meta id="base-url" data-url="{{base_url}}">
<meta id="badge-base-url" data-url="{{badge_base_url}}">
<!-- Other OG information in page.html -->
<meta property="og:description" content="{{social_desc}}">

{{ super() }}
<script src="{{static_url("dist/bundle.js")}}"></script>
<link href="{{static_url("dist/styles.css")}}" rel="stylesheet">
Expand Down
2 changes: 0 additions & 2 deletions binderhub/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@

<!-- Social media previews -->
<meta property="og:title" content="The Binder Project">
<meta property="og:description" content="Reproducible, sharable, interactive computing environments.">
<meta property="og:image" content="https://mybinder.org/static/images/logo_social.png">
<meta property="og:image:width" content="1334">
<meta property="og:image:height" content="700">
<meta property="og:image:alt" content="The Binder Project Logo" />

<meta name="twitter:card" content="summary_large_image">
{% endblock head %}
</head>
Expand Down

0 comments on commit 654b31d

Please sign in to comment.