diff --git a/.gitignore b/.gitignore index 6b9bbeb787f..627ad4ce350 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ third_party/acolyte # intellij files *.iml .idea + +## vitess.io preview site +preview-vitess.io/ diff --git a/preview-site.sh b/preview-site.sh new file mode 100755 index 00000000000..0b36ab6a463 --- /dev/null +++ b/preview-site.sh @@ -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 diff --git a/vitess.io/_config_dev.yml b/vitess.io/_config_dev.yml new file mode 100644 index 00000000000..9c62eaab244 --- /dev/null +++ b/vitess.io/_config_dev.yml @@ -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"] \ No newline at end of file