Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some issues with OG tags for social sharing #17

Merged
merged 6 commits into from
Jun 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: >-
OpenRA is an open source project that recreates and modernizes classic real time strategy games, like Red Alert, Command & Conquer, and Dune 2000.
tagline: >-
Classic strategy games rebuilt for the modern era
twitter_username: OpenRA
twitter_username: openRA
github_username: OpenRA
permalink: /:categories/:title/index.html

Expand Down
26 changes: 16 additions & 10 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no" />
<meta name="description" content="{{ site.description }}" />

{% capture social_title %}
{% if page.title %}
{{ page.title }} | {{ site.title }}
{% else %}
{{ site.title }}
{% endif %}
{% endcapture %}
<!-- OpenGraph -->
<meta property="og:title" content="OpenRA" />
<meta property="og:title" content="{{ social_title | strip }}" />
<meta property="og:type" content="website" />
<meta property="og:description" content="{{ site.description }}" />
<meta property="og:url" content="{{ site.url }}" />
<meta property="og:description" content="{{ site.tagline }}" />
<meta property="og:url" content="{{ page.url | absolute_url }}" />
<!-- query param at the end is for cache busting if/when more dynamic social images are added -->
<meta property="og:image" content="{{ '/images/social.jpg' | relative_url }}?t={{ site.time | date: "%Y-%m-%d-%H-%M" }}" />
<meta property="og:image" content="{{ '/images/social.jpg' | absolute_url }}?t={{ site.time | date: "%Y-%m-%d-%H-%M" }}" />
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@openRA">
<meta name="twitter:creator" content="@openRA">
<meta name="twitter:title" content="OpenRA">
<meta name="twitter:description" content="{{ site.description }}">
<!-- query param at the end is for cache busting if/when more dynamic social images are added -->
<meta name="twitter:image" content="{{ '/images/social.jpg' | relative_url }}?t={{ site.time | date: "%Y-%m-%d-%H-%M" }}">
<meta name="twitter:site" content="@{{ site.twitter_username }}">
<meta name="twitter:creator" content="@{{ site.twitter_username }}">

{% capture page_title %}
{% if page.title %}
Expand All @@ -27,6 +30,9 @@
{% endif %}
{% endcapture %}
<title>{{ page_title | strip }}</title>

<link rel="canonical" href="{{ page.url | absolute_url }}" />

<link rel="stylesheet" href="{{ '/styles/normalize.css' | relative_url }}" />
<link rel="stylesheet" href="{{ '/styles/index.css' | relative_url }}" />
<link rel="stylesheet" href="{{ '/styles/lite-youtube-embed.css' | relative_url }}" />
Expand Down