website/www: bintray downloads

This commit is contained in:
Mitchell Hashimoto 2013-12-09 00:17:20 -08:00
parent f3553a3e39
commit 86bb93ddb4
14 changed files with 211 additions and 67 deletions

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,4 @@
<ul class="unstyled">
<li<%= sidebar_current("downloads") %>><a href="/downloads.html">Latest</a></li>
<li<%= sidebar_current("downloads-archive") %>><a href="/downloads-archive.html">Old Versions</a></li>
</ul>

View File

@ -0,0 +1,19 @@
---
layout: "inner"
sidebar_current: "downloads-archive"
sidebar_template: "downloads"
sidebar_title: "Download"
page_title: "Download Old Versions of Vagrant"
---
<h2>Old Versions</h2>
<p>
Old versions of Vagrant can currently be found at the old downloads
website here: <a href="http://downloads.vagrantup.com/">http://downloads.vagrantup.com/</a>
</p>
<p>
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.
</p>

View File

@ -0,0 +1,43 @@
---
layout: "inner"
sidebar_current: "downloads"
sidebar_template: "downloads"
sidebar_title: "Download"
page_title: "Download Vagrant"
---
<h2>Download Vagrant</h2>
<div class="downloads">
<div class="description">
<p>
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 <a href="https://dl.bintray.com/mitchellh/vagrant/<%= latest_version %>_SHA256SUMS?direct">here</a>.
</p>
</div>
<% $vagrant_os.each do |os| %>
<div class="row">
<div class="span8 download">
<div class="icon pull-left"><%= image_tag "/images/icons/icon_#{os}.png" %></div>
<div class="details">
<h2 class="os-name"><%= download_os_human(os) %></h2>
<ul>
<% $vagrant_files[os].each do |file| %>
<li><a href="<%= download_url(file) %>"><%= download_arch(file) %></a></li>
<% end %>
</ul>
<div class="clearfix"></div>
</div>
</div>
</div>
<% end %>
<div class="poweredby">
<a href='http://www.bintray.com'>
<img src='http://www.bintray.com/docs/images/poweredByBintray_ColorTransparent.png'>
</a>
</div>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -52,7 +52,7 @@
<!-- nav -->
<ul class="pull-right unstyled">
<li class="pill"><a href="/vmware">VMware Integration</a></li>
<li><a href="http://downloads.vagrantup.com/">Downloads</a></li>
<li><a href="/downloads.html">Downloads</a></li>
<li><a href="http://docs.vagrantup.com/">Documentation</a></li>
<li><a href="/blog.html">Blog</a></li>
<li><a href="/about.html">About</a></li>

View File

@ -15,14 +15,14 @@
.search {
//.debug;
background: @white;
background: @white;
height: 60px;
input,
button,
form {
.kill-effects;
border: none;
border: none;
height: 60px;
font-size: 20px;
.museo-sans-light-italic;
@ -72,3 +72,73 @@
}
}
//downloads
.downloads {
.description {
margin-bottom: 20px;
}
.download {
border-bottom: 1px solid #b2b2b2;
padding-bottom: 15px;
margin-bottom: 15px;
.details {
padding-left: 95px;
ul {
margin: 0;
}
li {
display: inline-block;
&:after {
content: " | ";
}
&:last-child:after {
content: "";
}
}
a {
font-size: 22px;
color: @docs-blue;
text-decoration: none;
border-bottom: 1px solid @docs-blue;
&:hover {
color: darken(@blue, 10%);
border-bottom: 1px solid darken(@blue, 10%);
}
&:active {
}
}
}
.icon {
img {
width: 75px;
}
}
.os-name {
font-size: 40px;
margin-bottom: 3px;
}
}
.poweredby {
margin-top: 20px;
margin-bottom: 20px;
img {
display: block;
margin: 0 auto;
width: 122px;
}
}
}