diff --git a/website/www/config.rb b/website/www/config.rb index 00f936793..418cff3f0 100644 --- a/website/www/config.rb +++ b/website/www/config.rb @@ -1,61 +1,14 @@ -### -# Compass -### - -# Susy grids in Compass -# First: gem install susy --pre -# require 'susy' - -# Change Compass configuration -# compass_config do |config| -# config.output_style = :compact -# end - -### -# Page options, layouts, aliases and proxies -### - -# Per-page layout changes: -# -# With no layout -# page "/path/to/file.html", :layout => false -# -# With alternative layout -# page "/path/to/file.html", :layout => :otherlayout -# -# A path which all have the same layout -# with_layout :admin do -# page "/admin/*" -# end - -# Proxy (fake) files -# page "/this-page-has-no-template.html", :proxy => "/template-file.html" do -# @which_fake_page = "Rendering a fake page with a variable" -# end - page "/blog_feed.xml", layout: false -### -# Helpers -### - -# Automatic image dimensions on image_tag helper -# activate :automatic_image_sizes - -# Methods defined in the helpers block are available in templates -# helpers do -# def some_helper -# "Helping" -# end -# end - set :css_dir, 'stylesheets' set :js_dir, 'javascripts' set :images_dir, 'images' # Use the RedCarpet Markdown engine set :markdown_engine, :redcarpet -set :markdown, :fenced_code_blocks => true +set :markdown, + :fenced_code_blocks => true, + :with_toc_data => true # Enable the blog and set the time zone so that post times appear # correctly. @@ -73,18 +26,4 @@ configure :build do activate :minify_css activate :minify_html activate :minify_javascript - - # Enable cache buster - # activate :cache_buster - - # Use relative URLs - # activate :relative_assets - - # Compress PNGs after build - # First: gem install middleman-smusher - # require "middleman-smusher" - # activate :smusher - - # Or use a different image path - # set :http_path, "/Content/images/" end diff --git a/website/www/helpers/download_helpers.rb b/website/www/helpers/download_helpers.rb new file mode 100644 index 000000000..692c43c34 --- /dev/null +++ b/website/www/helpers/download_helpers.rb @@ -0,0 +1,69 @@ +require "net/http" + +$vagrant_files = {} +$vagrant_os = [] + +$vagrant_os_mappings = { + ".deb" => "debian", + ".dmg" => "darwin", + ".msi" => "windows", + ".rpm" => "rpm", +} + +if ENV["VAGRANT_VERSION"] + raise "BINTRAY_API_KEY must be set." if !ENV["BINTRAY_API_KEY"] + http = Net::HTTP.new("dl.bintray.com", 80) + req = Net::HTTP::Get.new("/mitchellh/vagrant") + req.basic_auth "mitchellh", ENV["BINTRAY_API_KEY"] + response = http.request(req) + + response.body.split("\n").each do |line| + next if line !~ /\/mitchellh\/vagrant\/(.+?)'/ + filename = $1.to_s + $vagrant_os_mappings.each do |suffix, os| + if filename.end_with?(suffix) + $vagrant_files[os] ||= [] + $vagrant_files[os] << filename + end + end + end + + $vagrant_os = $vagrant_files.keys + $vagrant_files.each do |key, value| + value.sort! + end +end + +module DownloadHelpers + def download_arch(file) + if file.include?("i686") + return "32-bit" + elsif file.include?("x86_64") + return "64-bit" + else + return "Universal (32 and 64-bit)" + end + end + + def download_os_human(os) + if os == "darwin" + return "Mac OS X" + elsif os == "debian" + return "Debian / Ubuntu" + elsif os == "rpm" + return "CentOS / RedHat / Fedora" + elsif os == "windows" + return "Windows" + else + return os + end + end + + def download_url(file) + "https://dl.bintray.com/mitchellh/vagrant/#{file}" + end + + def latest_version + ENV["VAGRANT_VERSION"] + end +end diff --git a/website/www/source/_sidebar_downloads.erb b/website/www/source/_sidebar_downloads.erb new file mode 100644 index 000000000..faf7b8f3b --- /dev/null +++ b/website/www/source/_sidebar_downloads.erb @@ -0,0 +1,4 @@ + diff --git a/website/www/source/downloads-archive.html.erb b/website/www/source/downloads-archive.html.erb new file mode 100644 index 000000000..b63f6bc5c --- /dev/null +++ b/website/www/source/downloads-archive.html.erb @@ -0,0 +1,19 @@ +--- +layout: "inner" +sidebar_current: "downloads-archive" +sidebar_template: "downloads" +sidebar_title: "Download" +page_title: "Download Old Versions of Vagrant" +--- + +

Old Versions

+ +

+Old versions of Vagrant can currently be found at the old downloads +website here: http://downloads.vagrantup.com/ +

+ +

+In the future, old versions will be transitioned to the new download +system, so please do not rely on the URLs at that web page. +

diff --git a/website/www/source/downloads.html.erb b/website/www/source/downloads.html.erb new file mode 100644 index 000000000..0c5e879bd --- /dev/null +++ b/website/www/source/downloads.html.erb @@ -0,0 +1,43 @@ +--- +layout: "inner" +sidebar_current: "downloads" +sidebar_template: "downloads" +sidebar_title: "Download" +page_title: "Download Vagrant" +--- + +

Download Vagrant

+ +
+
+

+Below are all available downloads for the latest version of Vagrant +(<%= latest_version %>). Please download the proper package for your +operating system and architecture. You can find SHA256 checksums +for packages here. +

+
+ +<% $vagrant_os.each do |os| %> +
+
+
<%= image_tag "/images/icons/icon_#{os}.png" %>
+
+

<%= download_os_human(os) %>

+ +
+
+
+
+<% end %> + +
+ + + +
+
diff --git a/website/www/source/images/icons/icon_darwin.png b/website/www/source/images/icons/icon_darwin.png new file mode 100644 index 000000000..c9ad9fe04 Binary files /dev/null and b/website/www/source/images/icons/icon_darwin.png differ diff --git a/website/www/source/images/icons/icon_debian.png b/website/www/source/images/icons/icon_debian.png new file mode 100644 index 000000000..e2d77c801 Binary files /dev/null and b/website/www/source/images/icons/icon_debian.png differ diff --git a/website/www/source/images/icons/icon_freebsd.png b/website/www/source/images/icons/icon_freebsd.png new file mode 100644 index 000000000..b5aad9299 Binary files /dev/null and b/website/www/source/images/icons/icon_freebsd.png differ diff --git a/website/www/source/images/icons/icon_linux.png b/website/www/source/images/icons/icon_linux.png new file mode 100644 index 000000000..7753dfb9e Binary files /dev/null and b/website/www/source/images/icons/icon_linux.png differ diff --git a/website/www/source/images/icons/icon_openbsd.png b/website/www/source/images/icons/icon_openbsd.png new file mode 100644 index 000000000..a9ee0423e Binary files /dev/null and b/website/www/source/images/icons/icon_openbsd.png differ diff --git a/website/www/source/images/icons/icon_rpm.png b/website/www/source/images/icons/icon_rpm.png new file mode 100644 index 000000000..871df56e0 Binary files /dev/null and b/website/www/source/images/icons/icon_rpm.png differ diff --git a/website/www/source/images/icons/icon_windows.png b/website/www/source/images/icons/icon_windows.png new file mode 100644 index 000000000..d7748c009 Binary files /dev/null and b/website/www/source/images/icons/icon_windows.png differ diff --git a/website/www/source/layouts/layout.erb b/website/www/source/layouts/layout.erb index d73eae749..84cd138c7 100644 --- a/website/www/source/layouts/layout.erb +++ b/website/www/source/layouts/layout.erb @@ -52,7 +52,7 @@