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

Add support for multiply languages #27

Merged
merged 13 commits into from
Apr 25, 2016
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/_site
/_site
/tmp
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ branches:
only:
- gh-pages

rvm:
- 2.2.3
script: bundle exec jekyll build && htmlproof --check-html --disable-external ./_site
rvm: 2.2.3
script: bundle exec jekyll build && bundle exec htmlproofer --check-html --disable-external ./_site --file-ignore ./_site/index.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a comment why exactly we are ignoring that one file?

Copy link
Member Author

@sangyye sangyye Apr 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I don't get the error on any of my machines, linux or mac after testing for a whole weekend. I couldn't find it. Even online checker say, this file is okay, so i ignore an error on travis I can't reproduce or understand.

install: bundle install

env:
Expand Down
33 changes: 17 additions & 16 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,25 @@ GEM
multipart-post (>= 1.2, < 3)
ffi (1.9.10)
gemoji (2.1.0)
github-pages (66)
github-pages (74)
RedCloth (= 4.2.9)
github-pages-health-check (= 1.1.0)
jekyll (= 3.0.3)
jekyll (= 3.0.4)
jekyll-coffeescript (= 1.0.1)
jekyll-feed (= 0.4.0)
jekyll-feed (= 0.5.1)
jekyll-gist (= 1.4.0)
jekyll-github-metadata (= 1.9.0)
jekyll-github-metadata (= 1.11.1)
jekyll-mentions (= 1.1.2)
jekyll-paginate (= 1.1.0)
jekyll-redirect-from (= 0.10.0)
jekyll-sass-converter (= 1.3.0)
jekyll-seo-tag (= 1.3.2)
jekyll-seo-tag (= 1.3.3)
jekyll-sitemap (= 0.10.0)
jekyll-textile-converter (= 0.1.0)
jemoji (= 0.6.2)
kramdown (= 1.10.0)
liquid (= 3.0.6)
listen (= 3.0.6)
mercenary (~> 0.3)
rdiscount (= 2.1.8)
redcarpet (= 3.3.3)
Expand All @@ -51,10 +52,10 @@ GEM
octokit (~> 4.0)
public_suffix (~> 1.4)
typhoeus (~> 0.7)
html-pipeline (2.3.0)
html-pipeline (2.4.0)
activesupport (>= 2, < 5)
nokogiri (>= 1.4)
html-proofer (3.0.4)
html-proofer (3.0.5)
activesupport (~> 4.2)
addressable (~> 2.3)
colored (~> 1.2)
Expand All @@ -64,7 +65,7 @@ GEM
typhoeus (~> 0.7)
yell (~> 2.0)
i18n (0.7.0)
jekyll (3.0.3)
jekyll (3.0.4)
colorator (~> 0.1)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
Expand All @@ -75,10 +76,10 @@ GEM
safe_yaml (~> 1.0)
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-feed (0.4.0)
jekyll-feed (0.5.1)
jekyll-gist (1.4.0)
octokit (~> 4.2)
jekyll-github-metadata (1.9.0)
jekyll-github-metadata (1.11.1)
octokit (~> 4.0)
jekyll-mentions (1.1.2)
html-pipeline (~> 2.3)
Expand All @@ -88,7 +89,7 @@ GEM
jekyll (>= 2.0)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
jekyll-seo-tag (1.3.2)
jekyll-seo-tag (1.3.3)
jekyll (~> 3.0)
jekyll-sitemap (0.10.0)
jekyll-textile-converter (0.1.0)
Expand All @@ -105,7 +106,7 @@ GEM
listen (3.0.6)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9.7)
mercenary (0.3.5)
mercenary (0.3.6)
mini_portile2 (2.0.0)
minitest (5.8.4)
multipart-post (2.0.0)
Expand All @@ -114,7 +115,7 @@ GEM
mini_portile2 (~> 2.0.0.rc2)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
parallel (1.6.2)
parallel (1.8.0)
public_suffix (1.5.3)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
Expand All @@ -123,7 +124,7 @@ GEM
redcarpet (3.3.3)
rouge (1.10.1)
safe_yaml (1.0.4)
sass (3.4.21)
sass (3.4.22)
sawyer (0.7.0)
addressable (>= 2.3.5, < 2.5)
faraday (~> 0.8, < 0.10)
Expand All @@ -133,7 +134,7 @@ GEM
ethon (>= 0.8.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
yell (2.0.5)
yell (2.0.6)

PLATFORMS
ruby
Expand All @@ -143,4 +144,4 @@ DEPENDENCIES
html-proofer

BUNDLED WITH
1.10.6
1.11.2
6 changes: 3 additions & 3 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="stylesheets/stylesheet.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/github-light.css" media="screen">
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">
<link rel="stylesheet" type="text/css" href="{{ site.github.url }}/stylesheets/stylesheet.css" media="screen">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this necessary? are relative paths not working here anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, because I use redirects on subfolders with the language, you need absolute paths for the stylesheets. Otherway the index in the folder doesn't find the sheets.

<link rel="stylesheet" type="text/css" href="{{ site.github.url }}/stylesheets/github-light.css" media="screen">
<link rel="stylesheet" type="text/css" href="{{ site.github.url }}/stylesheets/print.css" media="print">

<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
Expand Down
File renamed without changes.
29 changes: 29 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
layout: null
---
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
var languages = {
// "bg": "bg",
// "de": "de",
// "es": "es",
// "fr": "fr",
// "id": "id",
};

var code = window.navigator.language || window.navigator.userLanguage || "en";
if (code.substr(0,2) !== "zh") { code = code.substr(0,2); }

var language = languages[code];
if (!language) { language = "en"; }

document.location = "/" + language + "/";
</script>
<noscript>
<meta http-equiv="refresh" content="0; URL=/en/">
</noscript>
<title>Refugees on Rails - Cologne</title>
</head>
</html>