-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 31e4059
Showing
270 changed files
with
35,140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
tmp | ||
.DS_Store | ||
bin/ | ||
.bundle/ | ||
output | ||
.sass-cache | ||
build/ | ||
source/examples | ||
.mm-pid-* | ||
/b | ||
*.swp | ||
.rvmrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
source :rubygems | ||
|
||
gem "redcarpet" | ||
gem "activesupport" | ||
gem "highline" | ||
gem "rake" | ||
gem "coderay", :git => "git://github.com/dgeb/coderay.git", :branch => "handlebars" | ||
gem "middleman", '~> 3.0' | ||
gem "middleman-blog", "~> 3.0" | ||
gem "thin" | ||
gem "rack" | ||
gem "listen" | ||
gem "builder" | ||
|
||
group :development do | ||
gem "pry" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
GIT | ||
remote: git://github.com/dgeb/coderay.git | ||
revision: 73767aa80301ef5de74f625d597dde5cd940e74d | ||
branch: handlebars | ||
specs: | ||
coderay (1.0.8.rc1) | ||
|
||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
activesupport (3.2.6) | ||
i18n (~> 0.6) | ||
multi_json (~> 1.0) | ||
builder (3.1.3) | ||
chunky_png (1.2.5) | ||
coffee-script (2.2.0) | ||
coffee-script-source | ||
execjs | ||
coffee-script-source (1.3.3) | ||
compass (0.12.2) | ||
chunky_png (~> 1.2) | ||
fssm (>= 0.2.7) | ||
sass (~> 3.1) | ||
daemons (1.1.8) | ||
eventmachine (0.12.10) | ||
execjs (1.4.0) | ||
multi_json (~> 1.0) | ||
ffi (1.1.3) | ||
fssm (0.2.9) | ||
haml (3.1.6) | ||
highline (1.6.13) | ||
hike (1.2.1) | ||
http_router (0.10.2) | ||
rack (>= 1.0.0) | ||
url_mount (~> 0.2.1) | ||
i18n (0.6.0) | ||
listen (0.4.7) | ||
rb-fchange (~> 0.0.5) | ||
rb-fsevent (~> 0.9.1) | ||
rb-inotify (~> 0.8.8) | ||
maruku (0.6.0) | ||
syntax (>= 1.0.0) | ||
method_source (0.8.1) | ||
middleman (3.0.0) | ||
middleman-core (= 3.0.0) | ||
middleman-more (= 3.0.0) | ||
middleman-sprockets (= 3.0.0) | ||
middleman-blog (3.0.0) | ||
maruku (~> 0.6.0) | ||
middleman-core (~> 3.0.0) | ||
middleman-core (3.0.0) | ||
activesupport (~> 3.2.6) | ||
bundler (~> 1.1) | ||
listen (~> 0.4.7) | ||
rack (~> 1.4.1) | ||
rack-test (~> 0.6.1) | ||
thor (~> 0.15.4) | ||
tilt (~> 1.3.1) | ||
middleman-more (3.0.0) | ||
coffee-script (~> 2.2.0) | ||
coffee-script-source (~> 1.3.3) | ||
compass (>= 0.12.2) | ||
execjs (~> 1.4.0) | ||
haml (>= 3.1.6) | ||
i18n (~> 0.6.0) | ||
maruku (~> 0.6.0) | ||
middleman-core (= 3.0.0) | ||
padrino-helpers (= 0.10.7) | ||
sass (>= 3.1.20) | ||
uglifier (~> 1.2.6) | ||
middleman-sprockets (3.0.0) | ||
middleman-more (= 3.0.0) | ||
sprockets (~> 2.1) | ||
sprockets-sass (~> 0.8.0) | ||
multi_json (1.3.6) | ||
padrino-core (0.10.7) | ||
activesupport (~> 3.2.0) | ||
http_router (~> 0.10.2) | ||
sinatra (~> 1.3.1) | ||
thor (~> 0.15.2) | ||
tilt (~> 1.3.0) | ||
padrino-helpers (0.10.7) | ||
i18n (~> 0.6) | ||
padrino-core (= 0.10.7) | ||
pry (0.9.10) | ||
coderay (~> 1.0.5) | ||
method_source (~> 0.8) | ||
slop (~> 3.3.1) | ||
rack (1.4.1) | ||
rack-protection (1.2.0) | ||
rack | ||
rack-test (0.6.1) | ||
rack (>= 1.0) | ||
rake (10.0.0) | ||
rb-fchange (0.0.5) | ||
ffi | ||
rb-fsevent (0.9.1) | ||
rb-inotify (0.8.8) | ||
ffi (>= 0.5.0) | ||
redcarpet (2.1.1) | ||
sass (3.1.20) | ||
sinatra (1.3.2) | ||
rack (~> 1.3, >= 1.3.6) | ||
rack-protection (~> 1.2) | ||
tilt (~> 1.3, >= 1.3.3) | ||
slop (3.3.3) | ||
sprockets (2.4.5) | ||
hike (~> 1.2) | ||
multi_json (~> 1.0) | ||
rack (~> 1.0) | ||
tilt (~> 1.1, != 1.3.0) | ||
sprockets-sass (0.8.0) | ||
sprockets (~> 2.0) | ||
tilt (~> 1.1) | ||
syntax (1.0.0) | ||
thin (1.4.1) | ||
daemons (>= 1.0.9) | ||
eventmachine (>= 0.12.6) | ||
rack (>= 1.0.0) | ||
thor (0.15.4) | ||
tilt (1.3.3) | ||
uglifier (1.2.6) | ||
execjs (>= 0.3.0) | ||
multi_json (~> 1.3) | ||
url_mount (0.2.1) | ||
rack | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
activesupport | ||
builder | ||
coderay! | ||
highline | ||
listen | ||
middleman (~> 3.0) | ||
middleman-blog (~> 3.0) | ||
pry | ||
rack | ||
rake | ||
redcarpet | ||
thin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: thin start -p $PORT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## Ember Website | ||
|
||
The website for the Ember.js project. | ||
|
||
### Contributing | ||
|
||
To get started: | ||
|
||
``` | ||
git clone git://github.com/emberjs/website.git | ||
cd website | ||
bundle | ||
bundle exec middleman | ||
``` | ||
|
||
Then visit [http://localhost:4567/](http://localhost:4567/) | ||
|
||
### Examples | ||
|
||
The example apps are kept in a separate repository at [https://github.com/emberjs/examples](https://github.com/emberjs/examples). | ||
To get the most up-to-date version of them, run `rake examples:update` | ||
from the command line. This step is automatically done when you do a | ||
build. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
require "bundler/setup" | ||
|
||
def git_initialize(repository) | ||
unless File.exist?(".git") | ||
system "git init" | ||
system "git remote add origin https://github.com/emberjs/#{repository}.git" | ||
end | ||
end | ||
|
||
def git_update | ||
system "git fetch origin" | ||
system "git reset --hard origin/master" | ||
# Remove all files so we don't accidentally keep old stuff | ||
# These will be regenerated by the build process | ||
system "rm `git ls-files`" | ||
end | ||
|
||
def ember_path | ||
File.expand_path(ENV['EMBER_PATH'] || File.expand_path("../../ember.js", __FILE__)) | ||
end | ||
|
||
def generate_docs | ||
print "Generating docs data from #{ember_path}... " | ||
|
||
sha = nil | ||
|
||
Dir.chdir(ember_path) do | ||
# returns either `tag` or `tag-numcommits-gSHA` | ||
describe = `git describe --tags --always`.strip | ||
sha = describe =~ /-g(.+)/ ? $1 : describe | ||
|
||
Dir.chdir("docs") do | ||
system("npm install") unless File.exist?('node_modules') | ||
# Unfortunately -q doesn't always work so we get output | ||
system("./node_modules/.bin/yuidoc -p -q") | ||
end | ||
end | ||
|
||
# JSON is valid YAML | ||
data = YAML.load_file(File.join(ember_path, "docs/build/data.json")) | ||
data["project"]["sha"] = sha | ||
File.open(File.expand_path("../data/api.yml", __FILE__), "w") do |f| | ||
YAML.dump(data, f) | ||
end | ||
|
||
puts "Built #{sha}" | ||
end | ||
|
||
def build | ||
system "middleman build" | ||
end | ||
|
||
desc "Generate API Docs" | ||
task :generate_docs do | ||
generate_docs | ||
end | ||
|
||
desc "Build the website" | ||
task :build => :generate_docs do | ||
build | ||
end | ||
|
||
desc "Preview" | ||
task :preview do | ||
require 'listen' | ||
|
||
generate_docs | ||
|
||
paths = Dir.glob(File.join(ember_path, "packages/*/lib")) | ||
listener = Listen.to(*paths, :filter => /\.js$/) | ||
listener.change { generate_docs } | ||
listener.start(false) | ||
|
||
system "middleman server" | ||
end | ||
|
||
desc "Deploy the website to github pages" | ||
task :deploy do |t, args| | ||
require "highline/import" | ||
message = ask("Provide a deployment message: ") do |q| | ||
q.validate = /\w/ | ||
q.responses[:not_valid] = "Can't be empty." | ||
end | ||
|
||
mkdir_p "build" | ||
Dir.chdir "build" do | ||
git_initialize("emberjs.github.com") | ||
git_update | ||
|
||
build | ||
|
||
# This screws up the build and isn't necessary | ||
# rm_r "source/examples" | ||
|
||
File.open("CNAME", 'w') do |f| | ||
f.write "emberjs.com" | ||
end | ||
|
||
system "git add -A" | ||
system "git commit -m '#{message.gsub("'", "\\'")}'" | ||
system "git push origin master" unless ENV['NODEPLOY'] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
require 'redcarpet' | ||
require 'active_support/core_ext' | ||
|
||
Dir['./lib/*'].each { |f| require f } | ||
|
||
# Debugging | ||
set(:logging, ENV['RACK_ENV'] != 'production') | ||
|
||
set :markdown_engine, :redcarpet | ||
set :markdown, :layout_engine => :erb, | ||
:fenced_code_blocks => true, | ||
:lax_html_blocks => true, | ||
:renderer => Highlighter::HighlightedHTML.new | ||
|
||
activate :directory_indexes | ||
activate :toc | ||
activate :highlighter | ||
|
||
activate :api_docs, | ||
default_class: 'Ember', | ||
repo_url: 'https://github.com/emberjs/ember.js' | ||
|
||
### | ||
# Blog | ||
### | ||
|
||
activate :blog do |blog| | ||
blog.prefix = 'blog' | ||
blog.layout = 'layouts/blog' | ||
blog.summary_separator = %r{(<p>READMORE</p>)} # Markdown adds the <p> | ||
blog.taglink = "categories/:tag.html" | ||
end | ||
|
||
page '/blog/feed.xml', layout: false | ||
|
||
### | ||
# Pages | ||
### | ||
|
||
page 'guides*', layout: :guide do | ||
@guides = data.guides | ||
end | ||
|
||
page 'community.html' | ||
|
||
page 'index.html', proxy: 'about.html' | ||
|
||
page '404.html', directory_index: false | ||
|
||
# Don't build layouts standalone | ||
ignore '*_layout.erb' | ||
|
||
# Don't build API layouts | ||
ignore 'api/class.html.erb' | ||
ignore 'api/module.html.erb' | ||
|
||
### | ||
# Helpers | ||
### | ||
|
||
helpers do | ||
# Workaround for content_for not working in nested layouts | ||
def partial_for(key, partial_name=nil) | ||
@partial_names ||= {} | ||
if partial_name | ||
@partial_names[key] = partial_name | ||
else | ||
@partial_names[key] | ||
end | ||
end | ||
|
||
def rendered_partial_for(key) | ||
partial_name = partial_for(key) | ||
partial(partial_name) if partial_name | ||
end | ||
|
||
def link_to_page name, url | ||
path = request.path | ||
current = path =~ Regexp.new(url) | ||
|
||
if path == '/index.html' and name == 'about' | ||
current = true | ||
end | ||
|
||
class_name = current ? ' class="active"' : '' | ||
|
||
"<li#{class_name}><a href=\"#{url}\">#{name}</a></li>" | ||
end | ||
end |
Oops, something went wrong.