Skip to content

Commit bc715d8

Browse files
committed
first pass over README
1 parent 0dc6cb1 commit bc715d8

File tree

1 file changed

+32
-103
lines changed

1 file changed

+32
-103
lines changed

README.md

Lines changed: 32 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,37 @@
11
# scala-lang.org
22

3-
This repository contains the _static_ source of [scala-lang.org](http://scala-lang.org).
3+
This repository contains the source for [scala-lang.org](http://scala-lang.org).
44

5-
It does not contain the source of any content found under the [docs.scala-lang.org](http://docs.scala-lang.org) subdomain (instead, visit the [docs.scala-lang repo](http://github.com/scala/docs.scala-lang) for that source).
6-
7-
This is a static site generated by [Jekyll](https://github.com/mojombo/jekyll), and uses a whole host of open-source tools including a touch of Twitter's Bootstrap.
5+
It does not contain the source for the [docs.scala-lang.org](http://docs.scala-lang.org) subdomain. You can visit the [docs.scala-lang repo](https://github.com/scala/docs.scala-lang) if you are interested in contributing to the Scala documentation site.
86

97
## Dependencies
108

11-
This site uses a Jekyll, a Ruby framework. The required Jekyll version is 3.4.0.
12-
13-
## Building the site
14-
15-
There are two ways to run Jekyll to build the site:
16-
17-
1. Using [Bundler], so Jekyll and accompanying gems are installed only inside this directory.
18-
2. Using globally-installed Jekyll and accompanying gems.
19-
20-
The latter method is the one currently actually used on scala-lang.org. The
21-
former method is likely most convenient for users who already have a different
22-
version of Jekyll installed, or who are comfortable using Bundler and who don't
23-
want anything else installed system-wide.
24-
25-
### Option 1) Building with Bundler
26-
27-
`cd` into the directory where you cloned this repository, then install the
28-
required gems with `bundle install`. This will automatically put the gems into
29-
`./bundle-vendor/bundle`.
30-
31-
Start the server in the context of the bundle:
32-
33-
bundle exec jekyll serve
34-
35-
That's it.
36-
37-
If that doesn't work, to guarantee that your version of Ruby, etc, completely
38-
matches the production environment, you can also use `rbenv`. Start by `cd`ing
39-
into the directory where you cloned this repository, then execute the following:
40-
41-
rbenv install 2.3.1
42-
rbenv local 2.3.1
43-
rbenv rehash
44-
gem install bundle
45-
bundle install # This will automatically put the gems into `./bundle-vendor/bundle`
46-
bundle exec jekyll serve # Start the server in the context of the bundle
47-
48-
From this point, everything else should be the same, regardless of which method
49-
you used to run Jekyll.
50-
51-
### Option 2) Building with global Jekyll
52-
53-
Install Jekyll 3.4.0 on your system using RubyGems:
54-
55-
gem install jekyll -v 3.4.0
56-
57-
After cloning, `cd`ing into the directory where you cloned this repository and
58-
run:
9+
To build the site you can either use [Compose](https://github.com/docker/compose) or [Bundler](https://github.com/bundler/bundler). Compose is a good option if you are just getting
10+
started and want something simple. If you are already familiar with the Ruby ecosystem then Bundler
11+
might be the most comfortable for you.
5912

60-
jekyll serve
13+
Either way the site is built with [Jekyll](https://github.com/jekyll/jekyll) and is typeset mostly in
14+
Markdown.
6115

62-
and watch the output. You should see something like:
63-
64-
Configuration file: /Users/ben/src/scala-lang/_config.yml
65-
Source: /Users/ben/src/scala-lang
66-
Destination: /Users/ben/src/scala-lang/_site
67-
Incremental build: enabled
68-
Generating... done.
69-
Auto-regeneration: enabled for '/Users/ben/src/scala-lang'
70-
71-
### Windows and UTF-8
16+
## Building the site
17+
Make sure you are in the root directory of the cloned repository.
18+
### For Compose:
19+
```
20+
bin/serve
21+
```
7222

73-
If you get `incompatible encoding` errors when generating the site under Windows, then ensure that the
74-
console in which you are running jekyll can work with UTF-8 characters. As described in the blog
75-
[Solving UTF problem with Jekyll on Windows](http://joseoncode.com/2011/11/27/solving-utf-problem-with-jekyll-on-windows/)
76-
you have to execute `chcp 65001`. This command is best added to the `jekyll.bat`-script.
23+
### For Bundler:
24+
```
25+
bundle exec jekyll serve --incremental
26+
```
7727

7828
## Viewing the site
7929

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

82-
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.
32+
## Editing the Site
8333

84-
## YAML Front Matter
34+
### YAML Front Matter
8535

8636
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:
8737

@@ -103,31 +53,29 @@ You can use these fields in the YAML front matter later in your document. For ex
10353

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

106-
## Markdown
56+
### Recomended Markdown Editor
10757

108-
There are dozens of guides and cheatsheets that cover Markdown syntax out there, though this screenshot from the free OS X Markdown editor, [Mou](http://mouapp.com/), is an excellent and concise reference:
109-
110-
![Mou screen shot](http://25.io/mou/img/1.png)
58+
[Visual Studio Code](https://github.com/Microsoft/vscode) has great support for Scala, Git, and Markdown.
11159

11260
### Linking to internal pages
11361

114-
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)`
62+
The least error-prone way to make links is to use this format: `[link text]({{ site.baseurl }}/path/to/page/page.html)`
11563

116-
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)`
64+
`{{ site.baseurl }}` is a site-wide variable that represents the root directory of the static site. So, to display the Scala logo image you can simply write: `![Img alt text]({{ site.baseurl }}/resources/img/scala-logo.png)`
11765

118-
## Permalinks
66+
### Permalinks
11967

120-
In this new version of the scala-lang site we've tried to follow a `pretty permalink` style, so that any generated page will have an permalink finishing in a slash character (`/`). This will tell Jekyll to build that particular page as an `index.html` inside a folder with a name as specified in the provided permalink. i.e.: if a page has a permalink as follows:
68+
We trie to follow a [pretty permalink](https://jekyllrb.com/docs/permalinks/) style, so that any generated page will have a link finishing in a slash character (`/`). This will tell Jekyll to build that particular page as an `index.html` inside a folder with a name as specified in the provided permalink. i.e.: if a page has a permalink as follows:
12169

12270
`permalink: /what-is-scala/`
12371

124-
This will tell Jekyll to create a `what-is-scala` folder, with an `index.html` file inside. Links to this page will refer to the `{{site.baseurl}}/what-is-scala/`.
72+
This will tell Jekyll to create a `what-is-scala` directory, with an `index.html` file inside. Links to this page will refer to the `{{site.baseurl}}/what-is-scala/`.
12573

126-
## Custom collections and data
74+
### Custom collections and data
12775

128-
In the previous version of the site, data used in different pages was contained in categorized blogs. This has been changed to use custom collections. Every custom collection is a folder starting with an underscore character (`_`), containing a `markdown` file for each member of the collection. As any markdown containing a page in the site, it starts with a YAML front matter containing the data for this item, and can optionally contain markdown text to be rendered as html.
76+
Every [collection](https://jekyllrb.com/docs/collections/) is a directory starting with an underscore character (`_`), containing a Markdown file for each member of the collection. These Markdown files start with a YAML front matter containing the data for this item, and can optionally contain markdown text to be rendered as html.
12977

130-
Right now there are no collections being rendered as specific pages in the site (they're only consumed internally as static data), but in the future this can be changed by specifying the global `output: true` variable in the `_config.yml` custom collections section. You'll also need to specify a layout by using the `defaults` settings in the `_config.yml` file. i.e.:
78+
Right now there are no collections being rendered as specific pages in the site. They are only consumed internally as data. In the future this can be changed by specifying the global `output: true` variable in the `_config.yml` custom collections section. You will also need to specify a layout by using the `defaults` settings in the `_config.yml` file. i.e.:
13179

13280
```
13381
defaults:
@@ -138,13 +86,11 @@ defaults:
13886
layout: layout_name
13987
```
14088

141-
To access data from a custom collection just refer to `site.<collection_name>`. The collection's name will be the name of its folder sans the underscore character. i.e.: to access the data inside `_downloads`, you can do it as follows:
142-
143-
`site.downloads`
89+
To access data from a custom collection refer to `site.<collection-name>`. The collection's name will be the name of it's directory without the underscore character. i.e.: to access the data inside `_downloads`, use `site.downloads`.
14490

145-
Some of the data has been also modelled as YAML files inside the `_data` folder. Generally for data that is used throughout the site (i.e: the navigation bar links).
91+
Some of our data has been modelled as YAML files inside the `_data` folder. We generally do this for data that is used throughout the whole site. For example we do this for the navigation bar links.
14692

147-
## Resources and Workflow
93+
## The Backend
14894

14995
On every commit to the `scala/scala-lang` repository a [jenkins job](https://scala-webapps.epfl.ch/jenkins/view/All/job/production_scala-lang.org-builder/) 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.
15096

@@ -158,20 +104,3 @@ There are additional files on the webserver:
158104
- nightly builds in `/nightly/distributions/`
159105
- nightly api builds in `/nightly/docs-xxx/`
160106
- nightly pdf builds (spec etc) in `/nightly/pdfs`
161-
162-
## Templates
163-
164-
We have the following (general) templates:
165-
_(Note that this is not an exhaustive list.)_
166-
167-
#### page.html
168-
169-
Example YAML front matter with all possible fields:
170-
171-
---
172-
layout: page
173-
title: I Haz Build: An Autobiography of the Build Kitten
174-
by: Scala Jenkins (Build Kitty)
175-
---
176-
177-
[Bundler]: http://bundler.io/

0 commit comments

Comments
 (0)