The Scala Website
CSS HTML JavaScript Ruby PHP
Latest commit c4c0519 Mar 23, 2017 @axel22 axel22 committed on GitHub Merge pull request #623 from scala/axel22-patch-1
Add big data benchmark project
Permalink
Failed to load latest commit information.
.bundle change .bundle/config to the format `bundle install` prefers Oct 18, 2016
_data for local use, recommend Bundler and provide config Dec 17, 2015
_includes Removes jquery.stellar.min.js from footer, followup to #580 Dec 29, 2016
_layouts 2.11 -> 2.12 in some more places Dec 7, 2016
blog spelling Mar 14, 2017
community add scala/moocs room to community page Mar 17, 2017
contribute 2.11 -> 2.12 in some more places Dec 7, 2016
documentation 2.11 -> 2.12 in some more places Dec 7, 2016
download hello Scala 2.12.1! Dec 5, 2016
events this is training, not a conference Mar 20, 2017
feed Fix Atom feeds Aug 7, 2016
gsoc Update 2017.md Mar 23, 2017
news Update 2017-03-06-roadmap-2.13.md Mar 7, 2017
resources Announcing Scala/Spark MOOCs and Capstone Mar 13, 2017
training simplify _layouts and add sidebar to a few pages Nov 22, 2016
.gitignore avoid `vendor` directory conflict Dec 17, 2015
.travis.yml Fix #607 make Travis fail on Jekyll warnings Mar 4, 2017
Gemfile make Gemfile depend only on github-pages Nov 9, 2016
Gemfile.lock make Gemfile depend only on github-pages Nov 9, 2016
README.md fix Jekyll version number in readme Nov 18, 2016
_config.yml hello Scala 2.12.1! Dec 5, 2016
conduct.md Updates community page with Discourse and ML info, brings CoC to pari… Jan 26, 2017
index.md Promoting blog to frontpage of scala-lang Feb 4, 2016
license.md we aren't bothering to say Typesafe anymore in (C) notices Dec 14, 2016
robots.txt #46: the robots.txt file ready for production. Jul 30, 2013
what-is-scala.md fix typo in what-is-scala page Dec 31, 2013

README.md

scala-lang.org

This repository contains the static source of scala-lang.org. It does not contain the source of any content found under the docs.scala-lang.org subdomain (instead, visit the scala.github.com repo for that source).

It's a static site generated by Jekyll, and uses a whole host of open-source tools including a touch of Twitter's Bootstrap.

Dependencies

This site uses a Jekyll, a Ruby framework. The required Jekyll version is 3.3.0.

Building the site

There are two ways to run Jekyll to build the site:

  1. Using Bundler, so Jekyll and accompanying gems are installed only inside this directory.
  2. Using globally-installed Jekyll and accompanying gems.

The latter method is the one currently actually used on scala-lang.org. The former method is likely most convenient for users who already have a different version of Jekyll installed, or who are comfortable using Bundler and who don't want anything else installed system-wide.

Option 1) Building with Bundler

cd into the directory where you cloned this repository, then install the required gems with bundle install. This will automatically put the gems into ./bundle-vendor/bundle.

Start the server in the context of the bundle:

bundle exec jekyll serve

From this point, everything else should be the same, regardless of which method you used to run Jekyll.

Option 2) Building with global Jekyll

Install Jekyll 3.3.0 on your system using RubyGems:

gem install jekyll -v 3.3.0

After cloning, cd into the directory where you cloned this repository and run:

jekyll serve

and watch the output. You should see something like:

 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'

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 you have to execute chcp 65001. This command is best added to the jekyll.bat-script.

Viewing the site

Regardless of your method of running Jekyll, the generated site is available at http://localhost:4000.

If you add --watch to your Jekyll command line, 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.

YAML Front Matter

The "YAML Front Matter" is nothing more than the header on each page that you intend for Jekyll to parse. It contains information such as the name of the HTML template (layout) chosen for the specific document, and the title of the document. An example YAML front matter might look like:

---
layout: page
title: My page title
---

You can use these fields in the YAML front matter later in your document. For example, to make a header with the title of the document, in Markdown you would write:

---
layout: page
title: My page title
---

# {{ page.title }}

Body text here...

# {{ page.title }} would be rendered in HTML as, <h1>My page title</h1>.

Markdown

There are dozens of guides and cheatsheets that cover Markdown syntax out there, though this screenshot from the free OS X Markdown editor, Mou, is an excellent and concise reference:

Mou screen shot

Linking to internal pages

The least error-prone way to link between documents, to link to local images, or anything else: [link text]({{ site.baseurl }}/path/to/page/page.html)

Here, {{ site.baseurl }} is a site-wide variable that represents the root directory of the static site. So, to display the Scala logo image, located in img/scala-logo.png, one must simply write: ![Img alt text]({{ site.baseurl }}/resources/img/scala-logo.png)

Resources and Workflow

On every commit to the scala/scala-lang repository a jenkins job will generate the site using jekyll and copy the resulting files to the webserver. NOTE: the rsync of this job also deletes whatever is in the webserver directory with explicit exceptions: we need to keep the files listed below. Kind of a hack.

There are additional files on the webserver:

  • Subdirectory scala-lang.org/old is a static copy of the old website. It was generated once and copied there, and it stays like that.
  • Most of the files in /home/linuxsoft/archives/scala/ (on chara, accessible through ssh with your LAMP account) are synchronized to the subdirectory scala-lang.org/files/archive by another hourly jenkins job. This folder is used by the nightly and release jenkins jobs to publish scala releases:
    • distribution files (tarballs etc) in /
      • older distribution files, RCs in /old/ (not sure how exactly this is split up..)
    • api docs for distributions in /api/
    • nightly builds in /nightly/distributions/
    • nightly api builds in /nightly/docs-xxx/
    • nightly pdf builds (spec etc) in /nightly/pdfs

Templates

We have the following (general) templates: (Note that this is not an exhaustive list.)

page.html

Example YAML front matter with all possible fields:

---
layout: page
title: I Haz Build: An Autobiography of the Build Kitten
by: Scala Jenkins (Build Kitty)
---