Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for running site locally #7

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
source "http://rubygems.org"
source "https://rubygems.org"

gem "builder"
gem "rake"
#gem "kss"

gem "middleman", "~>3.1.5"
gem "middleman-favicon-maker"
gem "middleman-livereload"
gem "middleman-syntax"
#gem "middleman-smusher"
gem "redcarpet"
gem "susy", "2.0.0.alpha.4"
gem "breakpoint"
gem "typogruby"
gem "wdm", "~> 0.1.0", :platforms => [:mswin, :mingw]
gem 'rack-rewrite'
platforms :mri_18 do
gem "ruby18_source_location"
group :development do
gem "middleman", "~>3.1.5"
gem "middleman-favicon-maker"
gem "middleman-livereload"
gem "middleman-syntax"
gem "redcarpet"
gem "susy", "2.0.0.alpha.4"
gem "breakpoint"
gem "typogruby"
gem "wdm", "~> 0.1.0", :platforms => [:mswin, :mingw]
platforms :mri_18 do
gem "ruby18_source_location"
end
end

group :deploy do
gem 'rack-rewrite'
end
# gem "rack-codehighlighter"
# gem "pygments.rb"
4 changes: 1 addition & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
activesupport (3.2.14)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
breakpoint (2.0.7)
compass (>= 0.12.1)
sass (>= 3.2.0)
builder (3.2.2)
chunky_png (1.2.8)
coffee-script (2.2.0)
coffee-script-source
Expand Down Expand Up @@ -123,7 +122,6 @@ PLATFORMS

DEPENDENCIES
breakpoint
builder
middleman (~> 3.1.5)
middleman-favicon-maker
middleman-livereload
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,18 @@ If you would like to contribute to the Sass website, please do the following:
Thanks!

— Team Sass Design

---

## Running Site Locally

This site is built with [middleman](http://middlemanapp.com), a Ruby framework for building static sites.
You will need [Ruby](https://www.ruby-lang.org/en/downloads/), [rubygems](http://rubygems.org/) and
[bundler](http://bundler.io/) installed before you can run the site locally.

If the above dependencies are installed, in your command line of preference, navigate to the project repo and run:

```
bundle install
middleman
```
1 change: 0 additions & 1 deletion config.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require "builder"
require 'susy'
require 'breakpoint'
require 'middleman-syntax'
Expand Down
34 changes: 24 additions & 10 deletions config.ru
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
require "rubygems"
require "middleman"
require "typogruby"
require "rack/rewrite"

use Rack::Rewrite do
r301 %r{/docs/yardoc/(.*)}, '/documentation/$1'
r301 %r{/tutorial\.html}, '/guide'
r301 %r{/download\.html}, '/install'
end

run Middleman.server
if ENV["HEROKU"].nil? || ENV["HEROKU"] == 'false'
require "middleman"
run Middleman.server
else
require "rack/rewrite"

use Rack::Rewrite do
r301 %r{/docs/yardoc/(.*)}, '/documentation/$1'
r301 '/tutorial.html', '/guide'
r301 '/download.html', '/install'
r301 '/documentation', '/documentation/'

rewrite(%r{^(.*)/([^/.]+)$}, lambda do |match, rack_env|
path = "#{File.dirname(__FILE__)}/build#{match[0]}"
next "#{match[1]}/#{match[2]}/index.html" if Dir.exists?(path)
next match[0] if File.exists?(path)
"#{match[0]}.html"
end)
end

use Rack::Static, :urls => [""], :root => 'build', :index => 'index.html'

run lambda {}
end