Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
add vitess.io site preview script
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoshengzhe committed Feb 26, 2015
1 parent bed55f6 commit a686d66
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ third_party/acolyte
# intellij files
*.iml
.idea

## vitess.io preview site
preview-vitess.io/
42 changes: 42 additions & 0 deletions preview-site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#! /bin/bash

set -e

PREVIEW_DIR=preview-vitess.io

rm -rf $PREVIEW_DIR
mkdir $PREVIEW_DIR
cp -rf vitess.io/* $PREVIEW_DIR

mkdir $PREVIEW_DIR/_includes/doc
mkdir -p $PREVIEW_DIR/_posts/doc

# create ref files for each doc
for d in doc/*.md
do
name=${d:4}
title=${name%%.*}
docpath="$PREVIEW_DIR/_posts/doc/2015-01-01-${name}"
touch $docpath
echo "---" >> $docpath
echo "layout: doc" >> $docpath
echo "title: \"$title\"" >> $docpath
echo "categories: doc" >> $docpath
echo "toc: true" >> $docpath
echo "---" >> $docpath
echo "{% include $d %}" >> $docpath
done

# preserve links between docs
for d in `ls doc/*.md` README.md
do
python replace_doc_link.py doc $d > $PREVIEW_DIR/_includes/$d
done

# launch web site locally
cd $PREVIEW_DIR
bundle install
bundle exec jekyll serve --config _config_dev.yml
cd ..

rm -rf $PREVIEW_DIR
37 changes: 37 additions & 0 deletions vitess.io/_config_dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Site wide configuration

title: Vitess
description: "A set of servers and tools meant to facilitate scaling of MySQL databases for the web."
logo: 120x120.gif
teaser: 400x250.gif
locale: en_US
url:
project-name: Vitess
repo: https://github.com/youtube/vitess

# Jekyll configuration
sass:
sass_dir: _sass
style: compressed
permalink: /:categories/:title/
highlighter: pygments
gems:
- jekyll-sitemap

markdown: redcarpet

redcarpet:
extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "tables", "with_toc_data"]

# Site owner
owner:
name: Vitess Team
web: https://github.com/youtube/vitess
email:
twitter:
bio:
avatar:
disqus-shortname:


exclude: ["lib", "config.rb", ".sass-cache", "Capfile", "config", "log", "Rakefile", "Rakefile.rb", "tmp", "*.sublime-project", "*.sublime-workspace", "Gemfile", "Gemfile.lock", "README.md", "LICENSE", "node_modules", "Gruntfile.js", "package.json"]

0 comments on commit a686d66

Please sign in to comment.