Skip to content

Commit

Permalink
chore: og image fix (dart-lang#319)
Browse files Browse the repository at this point in the history
* Add new dev project to firebaserc
* Drop all single page overrides of the og:image
* site page head: fix description, og:type and og:image
* Update gem versions to eliminate deprecation warnings
Warnings like:
> DEPRECATION WARNING: You are using the a deprecated processor
interface Jekyll::Assets::Addons::Processors::Liquid.
* create _config_dev.yml used by serv_local.sh --dev

Fixes dart-lang#305
  • Loading branch information
chalin authored and kwalrath committed Jul 11, 2017
1 parent 5b84364 commit c1ea43c
Show file tree
Hide file tree
Showing 12 changed files with 85 additions and 65 deletions.
1 change: 1 addition & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"projects": {
"default": "www-dartlang-org",
"dev": "dartlang-org-dev",
"kw-staging": "kw-www-dartlang-1",
"sz" : "sz-www-1",
"sz2" : "sz-www-2"
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ gem 'bootstrap-sass'
gem 'font-awesome-sass'
gem 'html-proofer'
gem 'jekyll'
gem 'jekyll-assets', '2.1.2'
gem 'jekyll-assets'
gem 'jekyll-sitemap'
gem 'jekyll-toc'
gem 'kramdown'
Expand Down
92 changes: 47 additions & 45 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,98 +1,100 @@
GEM
remote: http://rubygems.org/
specs:
activesupport (5.0.0.1)
activesupport (5.1.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
addressable (2.4.0)
autoprefixer-rails (6.5.1)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
autoprefixer-rails (7.1.2.1)
execjs
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
colorator (1.1.0)
colored (1.2)
concurrent-ruby (1.0.2)
ethon (0.9.1)
concurrent-ruby (1.0.5)
ethon (0.10.1)
ffi (>= 1.3.0)
execjs (2.7.0)
fastimage (1.8.1)
addressable (~> 2.3, >= 2.3.5)
ffi (1.9.14)
font-awesome-sass (4.6.2)
extras (0.3.0)
forwardable-extended (~> 2.5)
fastimage (2.1.0)
ffi (1.9.18)
font-awesome-sass (4.7.0)
sass (>= 3.2)
forwardable-extended (2.6.0)
html-proofer (3.3.0)
html-proofer (3.7.2)
activesupport (>= 4.2, < 6.0)
addressable (~> 2.3)
colored (~> 1.2)
mercenary (~> 0.3.2)
nokogiri (~> 1.5)
nokogiri (~> 1.7)
parallel (~> 1.3)
typhoeus (~> 0.7)
yell (~> 2.0)
i18n (0.7.0)
jekyll (3.3.0)
i18n (0.8.5)
jekyll (3.5.0)
addressable (~> 2.4)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (~> 1.7)
safe_yaml (~> 1.0)
jekyll-assets (2.1.2)
fastimage (~> 1.8)
jekyll (~> 3.0)
sprockets (~> 3.3)
sprockets-helpers (~> 1.2)
tilt (~> 2.0)
jekyll-sass-converter (1.4.0)
jekyll-assets (2.3.2)
concurrent-ruby (~> 1.0)
extras (~> 0.2)
fastimage (~> 2.0, >= 1.8)
jekyll (~> 3.1, >= 3.0)
pathutil (>= 0.8)
rack (~> 1.6)
sprockets (~> 3.3, < 3.8)
jekyll-sass-converter (1.5.0)
sass (~> 3.4)
jekyll-sitemap (0.12.0)
jekyll-sitemap (1.1.1)
jekyll (~> 3.3)
jekyll-toc (0.1.1)
jekyll-toc (0.2.1)
nokogiri (~> 1.6)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
kramdown (1.12.0)
liquid (3.0.6)
kramdown (1.14.0)
liquid (4.0.0)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
mercenary (0.3.6)
mini_portile2 (2.1.0)
minitest (5.9.1)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
parallel (1.9.0)
mini_portile2 (2.2.0)
minitest (5.10.2)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
parallel (1.11.2)
pathutil (0.14.0)
forwardable-extended (~> 2.6)
rack (2.0.1)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
public_suffix (2.0.5)
rack (1.6.8)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rouge (1.11.1)
safe_yaml (1.0.4)
sass (3.4.22)
sprockets (3.7.0)
sass (3.4.25)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-helpers (1.2.1)
sprockets (>= 2.2)
thread_safe (0.3.5)
tilt (2.0.5)
thread_safe (0.3.6)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.2)
tzinfo (1.2.3)
thread_safe (~> 0.1)
uglifier (3.0.2)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
yell (2.0.6)
yell (2.0.7)

PLATFORMS
ruby
Expand All @@ -103,7 +105,7 @@ DEPENDENCIES
font-awesome-sass
html-proofer
jekyll
jekyll-assets (= 2.1.2)
jekyll-assets
jekyll-sitemap
jekyll-toc
kramdown
Expand All @@ -112,4 +114,4 @@ DEPENDENCIES
uglifier

BUNDLED WITH
1.13.5
1.15.0
4 changes: 1 addition & 3 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: Dart
description: "Dart is a platform for building structured apps. It includes a language, a VM, libraries, tools, and compilers to many targets, including JavaScript."
url: https://www.dartlang.org
baseurl: "" # the subpath of your site, e.g. /blog/
# permalink: /:path/:basename

# Global variables
# use case:
Expand Down Expand Up @@ -111,7 +109,7 @@ excerpt_separator: "~~~"
include: ["_pages"]
exclude: ["diagrams", "appengine", "tests", "site"]

gems:
plugins:
- jekyll-assets
- jekyll-toc
- jekyll-sitemap
Expand Down
2 changes: 2 additions & 0 deletions _config_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Site settings for development mode
url: https://dartlang-org-dev.firebaseapp.com
19 changes: 14 additions & 5 deletions serve_local.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
#!/usr/bin/env bash

if [ $1 == "frontpage" ]; then
jekyll build --watch --config _config.yml,scripts/frontpage_only_config.yml &
else
jekyll build --watch &
set -e -o pipefail

# cd `dirname $0`/..

if [[ "$1" == "--dev" && -e _config_dev.yml ]]; then
CONFIG="--config _config.yml,_config_dev.yml"
fi

if [[ "$1" == "frontpage" ]]; then
CONFIG="--config _config.yml,scripts/frontpage_only_config.yml"
fi

jekyll build $CONFIG --incremental --watch &

j_pid=$!
firebase serve --port 4000 &
f_pid=$!
echo "catched PIDs: $j_pid, $f_pid"
trap "{ kill $j_pid; kill $f_pid; exit 0;}" SIGINT
wait
wait
Binary file added src/_assets/images/dart-logo-for-shares.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/_guides/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
layout: guide
title: Get Started
description: "A guide for getting started with Dart."
image: https://www.dartlang.org/guides/images/get-started-flowchart.png
toc: false
---

Expand Down
26 changes: 19 additions & 7 deletions src/_includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
<meta charset="utf-8">
<meta http-equiv="Content-Language" content="en_US" />
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="viewport" content="width=device-width, initial-scale=1.0">{%
assign desc = page.description | default: page.excerpt | default: site.description | strip_html | strip_newlines | truncate: 160
%}
<meta name="description" content="{{desc}}">
<title>{% if page.short-title %}{{ page.short-title }}{% else %}{{ page.title }}{% endif %} | {{ site.title }}</title>
<meta name="description" content="{% if page.description %}{{ page.description | strip_html | strip_newlines | truncate: 160 }}{% else if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description | strip_html | strip_newlines | truncate: 160 }}{% endif %}">

<!-- Favicon / Touch Icons -->
<link href="/favicon.ico" rel="shortcut icon">
Expand All @@ -17,14 +19,24 @@
<meta name="twitter:card" content="summary" />
<meta name="twitter:site" content="@dart_lang" />
<meta name="twitter:title" content="{{ page.title }}" />
<meta name="twitter:description" content="{% if page.description | strip_html | strip_newlines | truncate: 160 %}{{ page.description }}{% else if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description | strip_html | strip_newlines | truncate: 160 }}{% endif %}" />
<meta name="twitter:description" content="{{desc}}" />

<!-- Open Graph -->
<meta property="og:title" content="{{ page.title }}" />
<meta property="og:description" content="{% if page.description | strip_html | strip_newlines | truncate: 160 %}{{ page.description }}{% else if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description | strip_html | strip_newlines | truncate: 160 }}{% endif %}" />
<meta property="og:type" content="website" />
<meta property="og:url" content="{{ site.url }}{{ page.url }}" />
<meta property="og:image" content="{% if page.image %}{{ page.image }}{% else %}{{ site.url }}{% asset_path 'dart-logo-wordmark.png' %}{% endif %}" />
<meta property="og:description" content="{{desc}}" />
<meta property="og:url" content="{{ page.url | absolute_url }}" />{%
assign og_image_asset = page.image_asset | default: layout.image_asset | default: 'dart-logo-for-shares.png' | asset_path %}{%
assign og_image_path = page.image | default: layout.image | default: og_image_asset %}{%
assign og_type = page.og_type | default: layout.og_type
%}{% comment %}
Add page URL to page relative paths
{% endcomment %}{%
assign og_image_start = og_image_path | slice: 0
%}{% unless og_image_start == '/' %}{% capture og_image_path %}{{page.url}}/{{og_image_path}}{% endcapture %}{% endunless %}
<meta property="og:image" content="{{og_image_path | absolute_url}}" />{%
if og_type %}
<meta property="og:type" content="{{og_type}}" />{%
endif %}

<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300,700' rel='stylesheet' type='text/css'>
Expand Down
1 change: 0 additions & 1 deletion src/community/who-uses-dart.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ title: 'Who Uses Dart'
permalink: /community/who-uses-dart
description: 'Companies and business that use Dart.'
toc: false
snippet_img: images/who-uses-dart.png
---

In no particular order, here are some companies and businesses that use Dart.
Expand Down
1 change: 0 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
layout: homepage
title: "Dart programming language"
description: "Dart is an application programming language that’s easy to learn, easy to scale, and deployable everywhere."
image: https://www.dartlang.org/samples/images/frontpage-sample.png
---
<section id="code-sample">
<div class="container">
Expand Down
1 change: 0 additions & 1 deletion src/resources/synonyms/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ layout: default
permalink: /resources/synonyms
title: "Synonyms - Dart, JavaScript, C#, Python"
description: "Dart idioms and snippets translated to JavaScript, Python, and C#."
snippet_img: images/dart-synonym-screenshot.png
toc: false
---

Expand Down

0 comments on commit c1ea43c

Please sign in to comment.