From 340e6ec778240c39bffb384d8c5030267fea3446 Mon Sep 17 00:00:00 2001 From: soc Date: Mon, 23 Nov 2015 15:39:06 -0500 Subject: [PATCH] for local use, recommend Bundler and provide config so that people can test the site locally without having to install stuff systemwide on their local machines originally contributed by Simon as part of a larger PR, so I've retained him as author on the commit. the only significant thing I (Seth) did differently was specify Jekyll 2, not 3, in Gemfile.lock, since Jekyll 2 is what we're using in production --- .bundle/config | 3 ++ .gitignore | 4 ++- Gemfile | 2 ++ Gemfile.lock | 73 ++++++++++++++++++++++++++++++++++++++ README.md | 30 +++++++++++----- _config.yml | 2 ++ _data/languages.yml | 86 +++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 190 insertions(+), 10 deletions(-) create mode 100644 .bundle/config create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 _data/languages.yml diff --git a/.bundle/config b/.bundle/config new file mode 100644 index 000000000..57d4641d1 --- /dev/null +++ b/.bundle/config @@ -0,0 +1,3 @@ +--- +BUNDLE_PATH: vendor/bundle +BUNDLE_DISABLE_SHARED_GEMS: '1' diff --git a/.gitignore b/.gitignore index f11e63506..1e12b7c98 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ _site/ -.DS_Store \ No newline at end of file +.DS_Store +/vendor/bundle/ +/.jekyll-metadata diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..167ee20bb --- /dev/null +++ b/Gemfile @@ -0,0 +1,2 @@ +source 'https://rubygems.org' +gem 'jekyll' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..45786ad05 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,73 @@ +GEM + remote: https://rubygems.org/ + specs: + blankslate (2.1.2.4) + celluloid (0.16.0) + timers (~> 4.0.0) + classifier-reborn (2.0.3) + fast-stemmer (~> 1.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.9.1.1) + colorator (0.1) + execjs (2.5.2) + fast-stemmer (1.0.2) + ffi (1.9.10) + hitimes (1.2.2) + jekyll (2.4.0) + classifier-reborn (~> 2.0) + colorator (~> 0.1) + jekyll-coffeescript (~> 1.0) + jekyll-gist (~> 1.0) + jekyll-paginate (~> 1.0) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 1.1) + kramdown (~> 1.3) + liquid (~> 2.6.1) + mercenary (~> 0.3.3) + pygments.rb (~> 0.6.0) + redcarpet (~> 3.1) + safe_yaml (~> 1.0) + toml (~> 0.1.0) + jekyll-coffeescript (1.0.1) + coffee-script (~> 2.2) + jekyll-gist (1.2.1) + jekyll-paginate (1.1.0) + jekyll-sass-converter (1.2.0) + sass (~> 3.2) + jekyll-watch (1.2.1) + listen (~> 2.7) + kramdown (1.5.0) + liquid (2.6.2) + listen (2.10.1) + celluloid (~> 0.16.0) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9) + mercenary (0.3.5) + parslet (1.5.0) + blankslate (~> 2.0) + posix-spawn (0.3.11) + pygments.rb (0.6.3) + posix-spawn (~> 0.3.6) + yajl-ruby (~> 1.2.0) + rb-fsevent (0.9.5) + rb-inotify (0.9.5) + ffi (>= 0.5.0) + redcarpet (3.3.1) + safe_yaml (1.0.4) + sass (3.4.16) + timers (4.0.1) + hitimes + toml (0.1.2) + parslet (~> 1.5.0) + yajl-ruby (1.2.1) + +PLATFORMS + ruby + +DEPENDENCIES + jekyll + +BUNDLED WITH + 1.10.6 diff --git a/README.md b/README.md index 3f5ae2eb2..4d01ea20b 100644 --- a/README.md +++ b/README.md @@ -6,23 +6,35 @@ It's a static site generated by [Jekyll](https://github.com/mojombo/jekyll), and ## Dependencies -You'll need Jekyll installed to generate and test the site. To get it, most people can install via RubyGems: +This site uses a Jekyll, a Ruby framework. You'll need Ruby and Bundler installed; see [Jekyll installation instructions](http://jekyllrb.com/docs/installation/) for the details. - gem install jekyll +## Building & Viewing -OSX users might have to update RubyGems: +cd into the directory where you cloned this repository, then install the required gems with `bundle install`. This will automatically put the gems into `./vendor/bundle`. - sudo gem update --system +Start the server in the context of the bundle: -If in doubt, head over to the [Jekyll wiki](https://github.com/mojombo/jekyll/wiki) for installation instructions. + bundle exec jekyll serve -## Building +and watch the output. You should see something like: -After cloning, cd into the `scala/scala-lang` directory and run: + Configuration file: /Users/ben/src/scala.github.com/_config.yml + Source: /Users/ben/src/scala.github.com + Destination: /Users/ben/src/scala.github.com/_site + Incremental build: enabled + Generating... done. + Auto-regeneration: enabled for '/Users/ben/src/scala-lang' - jekyll serve +The generated site is available at `http://localhost:4000`. -To see the generated site, just visit `http://localhost:4000`. +Jekyll will automatically watch for changes on the filesystem. When you change a file, the console will show that jekyll is regenerating. Wait until it says `done` to refresh your browser. + +### Windows and UTF-8 + +If you get `incompatible encoding` errors when generating the site under Windows, then ensure that the +console in which you are running jekyll can work with UTF-8 characters. As described in the blog +[Solving UTF problem with Jekyll on Windows](http://joseoncode.com/2011/11/27/solving-utf-problem-with-jekyll-on-windows/) +you have to execute `chcp 65001`. This command is best added to the `jekyll.bat`-script. ## YAML Front Matter diff --git a/_config.yml b/_config.yml index da3698bc3..fb6d69cfd 100644 --- a/_config.yml +++ b/_config.yml @@ -2,4 +2,6 @@ title: The Scala Programming Language scalaversion: "2.11.7" devscalaversion: "2.12.0-M3" + baseurl: "" +exclude: ["vendor"] \ No newline at end of file diff --git a/_data/languages.yml b/_data/languages.yml new file mode 100644 index 000000000..fa8d70293 --- /dev/null +++ b/_data/languages.yml @@ -0,0 +1,86 @@ +ar: + name: "العربية" + +bn: + name: "বাংলা" + +ca: + name: "Català" + +cs: + name: "Čeština" + +de: + name: "Deutsch" + +en: + name: "English" + +es: + name: "Español" + +fa: + name: "فارسی" + +fi: + name: "Suomi" + +fr: + name: "Français" + +he: + name: "עברית" + +hi: + name: "हिन्दी" + +hu: + name: "Magyar" + +id: + name: "Bahasa Indonesia" + +it: + name: "Italiano" + +ja: + name: "日本語" + +ko: + name: "한국어" + +nl: + name: "Nederlands" + +no: + name: "Norsk (Bokmål)" + +pl: + name: "Polski" + +pt: + name: "Português" + +"pt-br": + name: "Português (Brasil)" + +ru: + name: "Русский" + +sv: + name: "Svenska" + +tr: + name: "Türkçe" + +vi: + name: "Tiếng Việt" + +uk: + name: "Українська" + +"zh-cn": + name: "中文 (简体)" + +"zh-tw": + name: "中文 (繁體)"