Skip to content

Commit c9f285b

Browse files
author
Otto Chrons
committed
Fixed issues in OpenGraph meta tags.
Added a site-wise og:description. News are now og:article, rest are og:website
1 parent f4b0dfb commit c9f285b

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

_config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ gems: [jekyll-paginate]
55

66
# Site settings
77
title: Scala.js
8-
description: "Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description."
8+
description: "Build robust front-end web applications in Scala with Scala.js"
99
analytics: #Google analytics code in the format XX-nnnnnnnn-n
1010
# baseurl: ""
1111
baseurl: ""

_includes/head.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="author" content="">
77
<link rel="shortcut icon" href="{{ "/assets/img/scala-js-logo-32.png" | prepend: site.baseurl }}">
88

9-
<title>{{ site.title }}{% if page.title %} - {{ page.title }}{% endif %}</title>
9+
<title>{% if page.title %} {{ page.title }} - {% endif %}{{ site.title }}</title>
1010

1111
{% include ogp.html %}
1212
<!-- Bootstrap core CSS -->

_includes/ogp.html

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
{% capture header %}
22

33
{% if page.title %}
4-
<meta property="og:type" content="article" />
54
<meta property="og:title" content="{{ page.title }}" />
65
{% else %}
6+
<meta property="og:title" content="Scala.js" />
7+
{% endif %}
8+
9+
{% if page.category == "news" %}
10+
<meta property="og:type" content="article" />
11+
{% else %}
712
<meta property="og:type" content="website" />
813
{% endif %}
914

10-
{% include meta.html property="og:site_name" content=site.title %}
15+
{% if page.description %}
16+
<meta property="og:description" content="{{ page.description }}" />
17+
{% else %}
18+
<meta property="og:description" content="{{ site.description }}" />
19+
{% endif %}
1120

12-
{% capture page_url %}{{ page.url | replace:'/index.html','/' | prepend: site.url }}{% endcapture %}
13-
{% include meta.html property="og:url" content=page_url %}
21+
{% include meta.html property="og:site_name" content=site.title %}
1422

1523
{% capture image_url %}{{ site.url | append: '/assets/img/scala-js-logo-256.png'}}{% endcapture %}
1624
{% include meta.html content=image_url property="og:image" %}

index.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
layout: index
3-
title: Home
43
permalink: /
54
---
65
<div id="headerwrap">
@@ -10,7 +9,7 @@
109
<img width="100" src="{{ '/assets/img/scala-js-logo.svg' | prepend: site.baseurl }}">
1110

1211
<div>
13-
<h2 style="margin-top: 10px;">Scala.js</h2><h4>A safer way to build bug-free<br/> front-end web applications!</h4>
12+
<h2 style="margin-top: 10px;">Scala.js</h2><h4>A safer way to build robust<br/> front-end web applications!</h4>
1413
</div>
1514
<div>
1615
<a class="btn btn-theme" href="{{ site.baseurl }}/tutorial/">Learn Scala.js</a>
@@ -35,7 +34,7 @@ <h4>Correctness</h4>
3534
mixing up strings or numbers, forgetting what keys an object has, or
3635
worrying about typos in your method names. Scala.js takes care of all this
3736
tedious book-keeping for you, letting you focus on the actual, more interesting
38-
problem your website is trying to solve.
37+
problem your application is trying to solve.
3938
</div>
4039
<div class="col-md-4">
4140
<div class="center-align">

0 commit comments

Comments
 (0)