Skip to content

Commit

Permalink
Add initial GitHub pages infra for RocksDB documentation move and upd…
Browse files Browse the repository at this point in the history
…ate. (facebook#1294)

This is the initial commit with the templates necessary to have our RocksDB user documentation hosted on GitHub pages.

Ensure you meet requirements here: https://help.github.com/articles/setting-up-your-github-pages-site-locally-with-jekyll/#requirements

Then you can run this right now by doing the following:

```
% bundle install
% bundle exec jekyll serve --config=_config.yml,_config_local_dev.yml
```

Then go to: http://127.0.0.1:4000/

Obviously, this is just the skeleton. Moving forward we will do these things in separate pull requests:

- Replace logos with RocksDB logos
- Update the color schemes
- Add current information on rocksdb.org to markdown in this infra
- Migrate current Wodpress blog to Jekyll and Disqus comments
- Etc.
  • Loading branch information
JoelMarcey authored and IslamAbdelRahman committed Aug 24, 2016
1 parent 2a9c971 commit ea9e075
Show file tree
Hide file tree
Showing 105 changed files with 4,177 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.DS_STORE
_site/
*.swo
*.swp
_site
.sass-cache
*.psd
*~

2 changes: 2 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
136 changes: 136 additions & 0 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.7)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.10.0)
colorator (1.1.0)
ethon (0.9.0)
ffi (>= 1.3.0)
execjs (2.7.0)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.14)
forwardable-extended (2.6.0)
gemoji (2.1.0)
github-pages (93)
activesupport (= 4.2.7)
github-pages-health-check (= 1.2.0)
jekyll (= 3.2.1)
jekyll-coffeescript (= 1.0.1)
jekyll-feed (= 0.5.1)
jekyll-gist (= 1.4.0)
jekyll-github-metadata (= 2.0.2)
jekyll-mentions (= 1.1.3)
jekyll-paginate (= 1.1.0)
jekyll-redirect-from (= 0.11.0)
jekyll-sass-converter (= 1.3.0)
jekyll-seo-tag (= 2.0.0)
jekyll-sitemap (= 0.10.0)
jemoji (= 0.7.0)
kramdown (= 1.11.1)
liquid (= 3.0.6)
listen (= 3.0.6)
mercenary (~> 0.3)
minima (= 1.0.1)
rouge (= 1.11.1)
terminal-table (~> 1.4)
github-pages-health-check (1.2.0)
addressable (~> 2.3)
net-dns (~> 0.8)
octokit (~> 4.0)
public_suffix (~> 1.4)
typhoeus (~> 0.7)
html-pipeline (2.4.2)
activesupport (>= 2)
nokogiri (>= 1.4)
i18n (0.7.0)
jekyll (3.2.1)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (~> 1.7)
safe_yaml (~> 1.0)
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-feed (0.5.1)
jekyll-gist (1.4.0)
octokit (~> 4.2)
jekyll-github-metadata (2.0.2)
jekyll (~> 3.1)
octokit (~> 4.0)
jekyll-mentions (1.1.3)
html-pipeline (~> 2.3)
jekyll (~> 3.0)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.11.0)
jekyll (>= 2.0)
jekyll-sass-converter (1.3.0)
sass (~> 3.2)
jekyll-seo-tag (2.0.0)
jekyll (~> 3.1)
jekyll-sitemap (0.10.0)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
jemoji (0.7.0)
activesupport (~> 4.0)
gemoji (~> 2.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0)
json (1.8.3)
kramdown (1.11.1)
liquid (3.0.6)
listen (3.0.6)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9.7)
mercenary (0.3.6)
mini_portile2 (2.1.0)
minima (1.0.1)
minitest (5.9.0)
multipart-post (2.0.0)
net-dns (0.8.0)
nokogiri (1.6.8)
mini_portile2 (~> 2.1.0)
pkg-config (~> 1.1.7)
octokit (4.3.0)
sawyer (~> 0.7.0, >= 0.5.3)
pathutil (0.14.0)
forwardable-extended (~> 2.6)
pkg-config (1.1.7)
public_suffix (1.5.3)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
rouge (1.11.1)
safe_yaml (1.0.4)
sass (3.4.22)
sawyer (0.7.0)
addressable (>= 2.3.5, < 2.5)
faraday (~> 0.8, < 0.10)
terminal-table (1.6.0)
thread_safe (0.3.5)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)

PLATFORMS
ruby

DEPENDENCIES
github-pages

BUNDLED WITH
1.12.5
48 changes: 48 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Facebook Open Source Project Site Template: Jekyll Edition

This is a template for use with Jekyll. You can use it directly on a `gh-pages` branch where it will automatically serve up the content, or you can put it in your `master` branch using a script to copy the static generated markup (from the `_site` folder) into the gh-pages branch.

## Getting Started

Clone the contents of this folder, install Jekyll (currently targeting version 3.0), and then run:

```
jekyll serve --config=_config.yml,_config_local_dev.yml
```

This will serve up the site on your local device at http://127.0.0.1:4000/ - the `_config_local_dev` file over-rides some URL settings that you might be using in production to allow you to test locally without pesky relative URLs.

## Setting it Up

First, go through `_config.yml` and adjust the available settings to your project's standard. When you make changes here, you'll have to kill the `jekyll serve` instance and restart it to see those changes, but that's only the case with the config file.

Next, update some image assets - you'll want to update `favicon.png`, `logo.svg`, and `og_image.png` (used for Like button stories and Shares on Facbeook) in the `static` folder with your own logos.

Next, if you're going to have docs on your site, keep the `_docs` and `docs` folders, if not, you can safely remove them (or you can safely leave them and not include them in your navigation - Jekyll renders all of this before a client views the site anyway, so there's no performance hit from just leaving it there for a future expansion).

Same thing with a blog section, either keep or delete the `_posts` and `blog` folders.

You can customise your homepage in three parts - the first in the homepage header, which is mostly automatically derived from the elements you insert into your config file. However, you can also specify a series of 'promotional' elements in `_data/promo.yml`. You can read that file for more information.

The second place for your homepage is in `index.md` which contains the bulk of the main content below the header. This is all markdown if you want, but you can use HTML and Jekyll's template tags (called Liquid) in there too. Checkout this folder's index.md for an example of one common template tag that we use on our sites called gridblocks.

The third and last place is in the `_data/powered_by.yml` and `_data/powered_by_highlight.yml` files. Both these files combine to create a section on the homepage that is intended to show a list of companies or apps that are using your project. The `powered_by_highlight` file is a list of curated companies/apps that you want to show as a highlight at the top of this section, including their logos in whatever format you want. The `powered_by` file is a more open list that is just text links to the companies/apps and can be updated via Pull Request by the community. If you don't want these sections on your homepage, just empty out both files and leave them blank.

The last thing you'll want to do is setup your top level navigation bar. You can do this by editing `nav.yml` and keeping the existing title/href/category structure used there. Although the nav is responsive and fairly flexible design-wise, no more than 5 or 6 nav items is recommended.

## Docs

Editing docs is easy, you can just use lots of markdown. All you need to do is add a new `docname.md` file into the `_docs` folder with the following at the very top of the file (called the Front Matter):

```
---
docid: getting-started
title: Getting started with ProjectName
layout: docs
permalink: /docs/getting-started.html
---
```

Customise these values for each doc (note that the filename of the .md file doesn't actually matter, what is important is the `docid` being unique and the `permalink` correct and unique too).

Then you'll want to add your new doc to the Docs navigation. Just open `_data/nav_docs.yml` and add the `docid` of the doc you just created into the structure in the location that you want it to appear in the nav. Docs can be grouped in the navigation, checkout the skeleton `nav_docs` file that we've provided to see how you can do that.
59 changes: 59 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Site settings
permalink: /blog/:year/:month/:day/:title.html
title: RocksDB
tagline: A persistent key-value store for fast storage environments
description: >
RocksDB is an embeddable persistent key-value store for fast storage. RocksDB can also be the foundation for a client-server database but our current focus is on embedded workloads.
fbappid: "1615782811974223"
gacode: "UA-12345-6"
# baseurl determines the subpath of your site. For example if you're using an
# organisation.github.io/reponame/ basic site URL, then baseurl would be set
# as "/reponame/" but leave blank if you have a top-level domain URL
baseurl: ""
url: "http://rocksdb.org" # the base hostname & protocol for your site
ghrepo: "facebook/rocksdb"

# Use these color settings to determine your colour scheme for the site.
color:
# primary should be a vivid color that reflects the project's brand
primary: "#3b5998"
# secondary should be a subtle light or dark color used on page backgrounds
secondary: "#f9f9f9"
# Use the following to specify whether the previous two colours are 'light'
# or 'dark' and therefore what colors can be overlaid on them
primary-overlay: "dark"
secondary-overlay: "light"

#Uncomment this if you want to enable Algolia doc search with your own values
#searchconfig:
# apikey: ""
# indexname: ""

collections:
docs:
output: true
permalink: /docs/:name/
support:
output: true
permalink: /support.html

# DO NOT ADJUST BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE CHANGING

markdown: kramdown
kramdown:
input: GFM
syntax_highlighter: rouge

syntax_highlighter_opts:
css_class: 'rougeHighlight'
span:
line_numbers: false
block:
line_numbers: true
start_line: 1

sass:
style: :compressed

redcarpet:
extensions: [with_toc_data]
6 changes: 6 additions & 0 deletions docs/_config_local_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Local development config settings to over-ride base.
# `jekyll serve` will by default generate a webserver at localhost:4000, so
# only change `url` if you're using a non-default location.

baseurl: ""
url: "http://127.0.0.1:4000"
4 changes: 4 additions & 0 deletions docs/_data/authors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

exampleauthor:
full_name: Example Author
fbid: 1234
19 changes: 19 additions & 0 deletions docs/_data/features.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
- title: Feature 1
text: |
This is a description of the feature which **can** use [markdown](#).
image: images/android.svg

- title: Feature 2
text: |
This is another description of a feature.
image: images/apple.svg

- title: Feature 3
text: |
This is another description of a feature.
image: images/facebook.png

- title: Feature 4
text: |
This is another description of a feature.
image: images/instagram.png
15 changes: 15 additions & 0 deletions docs/_data/nav.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- title: Docs
href: /docs/
category: docs

- title: Support
href: /support.html
category: support

- title: Blog
href: /blog/
category: blog

- title: Facebook
href: http://www.facebook.com/
category: facebook
7 changes: 7 additions & 0 deletions docs/_data/nav_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- title: Quick Start
items:
- id: getting-started
- id: hello-world
- title: Another Doc Group
items:
- id: making-changes
6 changes: 6 additions & 0 deletions docs/_data/powered_by.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- title: Who Uses This Project?
items:
- name: Example Company
url: https://www.example.com/
- name: Another Example
url: https://www.example.com
14 changes: 14 additions & 0 deletions docs/_data/powered_by_highlight.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- title: Who Uses This Project?
items:
- name: Facebook
url: https://facebook.com
img: static/images/facebook.png
- name: Instagram
url: https://www.instagram.com
img: static/images/instagram.png
- name: Facebook
url: https://facebook.com
img: static/images/facebook.png
- name: Instagram
url: https://www.instagram.com
img: static/images/instagram.png
28 changes: 28 additions & 0 deletions docs/_data/promo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This file determines the list of promotional elements added to the header of \
# your site's homepage. Full list of plugins are shown

- type: button
href: docs/getting-started.html
text: Example Button

- type: github_star

- type: github_watch

- type: like_button

- type: google_share

- type: twitter_follow
href: FbOpenSource

- type: twitter_share

- type: plugin_row
children:
- type: button
href: docs/getting-started.html
text: Get Started
- type: button
href: https://example.com
text: Another Button
8 changes: 8 additions & 0 deletions docs/_docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
docid: getting-started
title: Getting started with ProjectName
layout: docs
permalink: /docs/getting-started.html
---

This is some placeholder text, but you can use any kind of Markdown syntax here.
8 changes: 8 additions & 0 deletions docs/_docs/hello-world.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
docid: hello-world
title: Hello, World!
layout: docs
permalink: /docs/hello-world.html
---

This is some placeholder text, but you can use any kind of Markdown syntax here.
Loading

0 comments on commit ea9e075

Please sign in to comment.