diff --git a/website/Gemfile b/website/Gemfile index 99e3e69cc..936305b5e 100644 --- a/website/Gemfile +++ b/website/Gemfile @@ -1,13 +1,3 @@ -source "https://rubygems.org" +source 'https://rubygems.org' -gem "less", "~> 2.6" -gem "middleman", "~> 3.3" -gem "middleman-minify-html", "~> 3.4" -gem "rack-contrib", "~> 1.1" -gem "redcarpet", "~> 3.1" -gem "therubyracer", "~> 0.12" -gem "thin", "~> 1.6" - -group :development do - gem "highline", "~> 1.6" -end +gem 'middleman-hashicorp', github: 'hashicorp/middleman-hashicorp' diff --git a/website/Gemfile.lock b/website/Gemfile.lock index dd50f1ecc..faf7ce071 100644 --- a/website/Gemfile.lock +++ b/website/Gemfile.lock @@ -1,3 +1,20 @@ +GIT + remote: git://github.com/hashicorp/middleman-hashicorp.git + revision: fe7d5bb4b04c408857dbe94345341cafcbc02de4 + specs: + middleman-hashicorp (0.1.0) + bootstrap-sass (~> 3.2) + builder (~> 3.2) + less (~> 2.6) + middleman (~> 3.3) + middleman-livereload (~> 3.3) + middleman-minify-html (~> 3.4) + middleman-syntax (~> 2.0) + rack-contrib (~> 1.1) + redcarpet (~> 3.1) + therubyracer (~> 0.12) + thin (~> 1.6) + GEM remote: https://rubygems.org/ specs: @@ -7,6 +24,9 @@ GEM minitest (~> 5.1) thread_safe (~> 0.1) tzinfo (~> 1.1) + bootstrap-sass (3.2.0.2) + sass (~> 3.2) + builder (3.2.2) celluloid (0.16.0) timers (~> 4.0.0) chunky_png (1.3.1) @@ -28,18 +48,21 @@ GEM compass-import-once (1.0.5) sass (>= 3.2, < 3.5) daemons (1.1.9) + em-websocket (0.5.1) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) erubis (2.7.0) eventmachine (1.0.3) execjs (2.2.1) ffi (1.9.5) haml (4.0.5) tilt - highline (1.6.21) hike (1.2.3) hitimes (1.2.2) hooks (0.4.0) uber (~> 0.0.4) htmlcompressor (0.1.2) + http_parser.rb (0.6.0) i18n (0.6.11) json (1.8.1) kramdown (1.4.2) @@ -73,6 +96,10 @@ GEM rack-test (~> 0.6.2) thor (>= 0.15.2, < 2.0) tilt (~> 1.4.1, < 2.0) + middleman-livereload (3.3.4) + em-websocket (~> 0.5.1) + middleman-core (~> 3.2) + rack-livereload (~> 0.3.15) middleman-minify-html (3.4.0) htmlcompressor (~> 0.1.0) middleman-core (>= 3.2) @@ -81,6 +108,9 @@ GEM sprockets (~> 2.12.1) sprockets-helpers (~> 1.1.0) sprockets-sass (~> 1.2.0) + middleman-syntax (2.0.0) + middleman-core (~> 3.2) + rouge (~> 1.0) minitest (5.4.2) multi_json (1.10.1) padrino-helpers (0.12.3) @@ -92,6 +122,8 @@ GEM rack (1.5.2) rack-contrib (1.1.0) rack (>= 0.9.1) + rack-livereload (0.3.15) + rack rack-test (0.6.2) rack (>= 1.0) rb-fsevent (0.9.4) @@ -99,6 +131,7 @@ GEM ffi (>= 0.5.0) redcarpet (3.1.2) ref (1.0.5) + rouge (1.7.2) sass (3.4.5) sprockets (2.12.2) hike (~> 1.2) @@ -133,11 +166,4 @@ PLATFORMS ruby DEPENDENCIES - highline (~> 1.6) - less (~> 2.6) - middleman (~> 3.3) - middleman-minify-html (~> 3.4) - rack-contrib (~> 1.1) - redcarpet (~> 3.1) - therubyracer (~> 0.12) - thin (~> 1.6) + middleman-hashicorp! diff --git a/website/config.rb b/website/config.rb index 5d77fc11e..d28854f76 100644 --- a/website/config.rb +++ b/website/config.rb @@ -1,93 +1,10 @@ -require "net/http" - -raise "PACKER_VERSION must be set." if !ENV["PACKER_VERSION"] - -#------------------------------------------------------------------------- -# Download the list of Packer downloads -#------------------------------------------------------------------------- - -$packer_files = {} -$packer_os = [] - -if !ENV["PACKER_DISABLE_DOWNLOAD_FETCH"] - 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/packer/") - req.basic_auth "mitchellh", ENV["BINTRAY_API_KEY"] - response = http.request(req) - - response.body.split("\n").each do |line| - next if line !~ /\/mitchellh\/packer\/packer_(#{Regexp.quote(ENV["PACKER_VERSION"])}.+?)'/ - filename = $1.to_s - os = filename.split("_")[1] - next if os == "SHA256SUMS" - - $packer_files[os] ||= [] - $packer_files[os] << filename - end - - $packer_os = ["darwin", "linux", "windows"] & $packer_files.keys - $packer_os += $packer_files.keys - $packer_os.uniq! - - $packer_files.each do |key, value| - value.sort! - end -end - #------------------------------------------------------------------------- # Configure Middleman #------------------------------------------------------------------------- -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, - :with_toc_data => true - -# Build-specific configuration -configure :build do - activate :asset_hash - activate :minify_css - activate :minify_html - activate :minify_javascript -end - -#------------------------------------------------------------------------- -# Helpers -#------------------------------------------------------------------------- -helpers do - def download_arch(file) - parts = file.split("_") - return "" if parts.length != 3 - parts[2].split(".")[0] - end - - def download_os_human(os) - if os == "darwin" - return "Mac OS X" - elsif os == "freebsd" - return "FreeBSD" - elsif os == "openbsd" - return "OpenBSD" - elsif os == "Linux" - return "Linux" - elsif os == "windows" - return "Windows" - else - return os - end - end - - def download_url(file) - "https://dl.bintray.com/mitchellh/packer/packer_#{file}" - end - - def latest_version - ENV["PACKER_VERSION"] - end +activate :hashicorp do |h| + h.version = '0.7.1' + h.bintray_repo = 'mitchellh/packer' + h.bintray_user = 'mitchellh' + h.bintray_key = ENV['BINTRAY_API_KEY'] end diff --git a/website/config.ru b/website/config.ru index 5cf4e322d..fd8f01d6c 100644 --- a/website/config.ru +++ b/website/config.ru @@ -12,7 +12,7 @@ use Rack::Deflater # to do. use Rack::StaticCache, :root => "build", - :urls => ["/images", "/javascripts", "/stylesheets"], + :urls => ["/assets"], :duration => 2, :versioning => false diff --git a/website/source/fonts/2772B2_0_0.eot b/website/source/assets/fonts/2772B2_0_0.eot similarity index 100% rename from website/source/fonts/2772B2_0_0.eot rename to website/source/assets/fonts/2772B2_0_0.eot diff --git a/website/source/fonts/2772B2_0_0.ttf b/website/source/assets/fonts/2772B2_0_0.ttf similarity index 100% rename from website/source/fonts/2772B2_0_0.ttf rename to website/source/assets/fonts/2772B2_0_0.ttf diff --git a/website/source/fonts/2772B2_0_0.woff b/website/source/assets/fonts/2772B2_0_0.woff similarity index 100% rename from website/source/fonts/2772B2_0_0.woff rename to website/source/assets/fonts/2772B2_0_0.woff diff --git a/website/source/images/arrow-left.png b/website/source/assets/images/arrow-left.png similarity index 100% rename from website/source/images/arrow-left.png rename to website/source/assets/images/arrow-left.png diff --git a/website/source/images/arrow-right.png b/website/source/assets/images/arrow-right.png similarity index 100% rename from website/source/images/arrow-right.png rename to website/source/assets/images/arrow-right.png diff --git a/website/source/images/divider.png b/website/source/assets/images/divider.png similarity index 100% rename from website/source/images/divider.png rename to website/source/assets/images/divider.png diff --git a/website/source/images/down_arrow.png b/website/source/assets/images/down_arrow.png similarity index 100% rename from website/source/images/down_arrow.png rename to website/source/assets/images/down_arrow.png diff --git a/website/source/images/hero_image.jpg b/website/source/assets/images/hero_image.jpg similarity index 100% rename from website/source/images/hero_image.jpg rename to website/source/assets/images/hero_image.jpg diff --git a/website/source/images/logo_footer.png b/website/source/assets/images/logo_footer.png similarity index 100% rename from website/source/images/logo_footer.png rename to website/source/assets/images/logo_footer.png diff --git a/website/source/images/logo_nav.png b/website/source/assets/images/logo_nav.png similarity index 100% rename from website/source/images/logo_nav.png rename to website/source/assets/images/logo_nav.png diff --git a/website/source/images/screenshots/vmware_and_virtualbox.png b/website/source/assets/images/screenshots/vmware_and_virtualbox.png similarity index 100% rename from website/source/images/screenshots/vmware_and_virtualbox.png rename to website/source/assets/images/screenshots/vmware_and_virtualbox.png diff --git a/website/source/images/screenshots/works_with.png b/website/source/assets/images/screenshots/works_with.png similarity index 100% rename from website/source/images/screenshots/works_with.png rename to website/source/assets/images/screenshots/works_with.png diff --git a/website/source/images/user_bbc.png b/website/source/assets/images/user_bbc.png similarity index 100% rename from website/source/images/user_bbc.png rename to website/source/assets/images/user_bbc.png diff --git a/website/source/images/user_disqus.png b/website/source/assets/images/user_disqus.png similarity index 100% rename from website/source/images/user_disqus.png rename to website/source/assets/images/user_disqus.png diff --git a/website/source/images/user_edgecast.png b/website/source/assets/images/user_edgecast.png similarity index 100% rename from website/source/images/user_edgecast.png rename to website/source/assets/images/user_edgecast.png diff --git a/website/source/images/user_expedia.png b/website/source/assets/images/user_expedia.png similarity index 100% rename from website/source/images/user_expedia.png rename to website/source/assets/images/user_expedia.png diff --git a/website/source/images/works_with_aws.png b/website/source/assets/images/works_with_aws.png similarity index 100% rename from website/source/images/works_with_aws.png rename to website/source/assets/images/works_with_aws.png diff --git a/website/source/images/works_with_virtual.png b/website/source/assets/images/works_with_virtual.png similarity index 100% rename from website/source/images/works_with_virtual.png rename to website/source/assets/images/works_with_virtual.png diff --git a/website/source/images/works_with_vmware.png b/website/source/assets/images/works_with_vmware.png similarity index 100% rename from website/source/images/works_with_vmware.png rename to website/source/assets/images/works_with_vmware.png diff --git a/website/source/javascripts/lang-go.js b/website/source/assets/javascripts/lang-go.js similarity index 100% rename from website/source/javascripts/lang-go.js rename to website/source/assets/javascripts/lang-go.js diff --git a/website/source/javascripts/prettify.js b/website/source/assets/javascripts/prettify.js similarity index 100% rename from website/source/javascripts/prettify.js rename to website/source/assets/javascripts/prettify.js diff --git a/website/source/stylesheets/_components.scss b/website/source/assets/stylesheets/_components.scss similarity index 96% rename from website/source/stylesheets/_components.scss rename to website/source/assets/stylesheets/_components.scss index 2f03d3c9a..c2dcff55c 100644 --- a/website/source/stylesheets/_components.scss +++ b/website/source/assets/stylesheets/_components.scss @@ -15,7 +15,7 @@ header .header { .hero { height: $hero-height; - background: #000000 url(/images/hero_image.jpg) no-repeat 35px -40px; + background: #000000 image-url('hero_image.jpg') no-repeat 35px -40px; background-size: 960px 467px; h2 { @@ -30,7 +30,7 @@ header .header { } .download-container { - background: url(/images/down_arrow.png) no-repeat top left; + background: image-url('down_arrow.png') no-repeat top left; display: inline-block; min-height: 73px; margin: 0 auto; @@ -294,7 +294,7 @@ header .header { width: $nav-height; border-right: $border; float: left; - background: $white url(/images/arrow-left.png) no-repeat center center; + background: $white image-url('arrow-left.png') no-repeat center center; @include respond-to(mobile) { width: 50%; background-position: left center; @@ -302,7 +302,7 @@ header .header { } .next-section { - background: $white url(/images/arrow-right.png) no-repeat center right; + background: $white image-url('arrow-right.png') no-repeat center right; } } diff --git a/website/source/stylesheets/_footer.scss b/website/source/assets/stylesheets/_footer.scss similarity index 94% rename from website/source/stylesheets/_footer.scss rename to website/source/assets/stylesheets/_footer.scss index 686a242e6..b20aabcf5 100644 --- a/website/source/stylesheets/_footer.scss +++ b/website/source/assets/stylesheets/_footer.scss @@ -29,7 +29,7 @@ margin-left: -20px; } .hashi-logo { - background: url(/images/logo_footer.png) no-repeat center top; + background: image-url('logo_footer.png') no-repeat center top; height: 40px; width: 40px; background-size: 37px 40px; diff --git a/website/source/stylesheets/_helpers.scss b/website/source/assets/stylesheets/_helpers.scss similarity index 93% rename from website/source/stylesheets/_helpers.scss rename to website/source/assets/stylesheets/_helpers.scss index 0c6dba52f..fc481f359 100644 --- a/website/source/stylesheets/_helpers.scss +++ b/website/source/assets/stylesheets/_helpers.scss @@ -58,9 +58,9 @@ $mono: 'Inconsolata', 'courier new', courier, mono-space; @font-face { font-family: 'HeimatStencil-SemiBold'; - src: url('../../fonts/2772B2_0_0.eot'); - src: url('../../fonts/2772B2_0_0.woff') format('woff'), - url('../../fonts/2772B2_0_0.ttf') format('truetype'); + src: font-url('2772B2_0_0.eot'); + src: font-url('2772B2_0_0.woff') format('woff'), + font-url('2772B2_0_0.ttf') format('truetype'); font-weight: normal; font-style: normal; } @@ -89,7 +89,7 @@ background-color: $white; //elements .divider { -background: url(/images/divider.png) no-repeat center bottom; +background: image-url('divider.png') no-repeat center bottom; height: 70px; width: 70px; background-size: 70px 70px; diff --git a/website/source/stylesheets/_nav.scss b/website/source/assets/stylesheets/_nav.scss similarity index 91% rename from website/source/stylesheets/_nav.scss rename to website/source/assets/stylesheets/_nav.scss index 279b7155b..4ad3fcb33 100644 --- a/website/source/stylesheets/_nav.scss +++ b/website/source/assets/stylesheets/_nav.scss @@ -22,7 +22,7 @@ nav { } .packer-logo { - background: url(/images/logo_nav.png) no-repeat center top; + background: image-url('logo_nav.png') no-repeat center top; height: 80px; width: 80px; background-size: 34px 50px; diff --git a/website/source/stylesheets/_reset.scss b/website/source/assets/stylesheets/_reset.scss similarity index 100% rename from website/source/stylesheets/_reset.scss rename to website/source/assets/stylesheets/_reset.scss diff --git a/website/source/stylesheets/_sidebar.scss b/website/source/assets/stylesheets/_sidebar.scss similarity index 100% rename from website/source/stylesheets/_sidebar.scss rename to website/source/assets/stylesheets/_sidebar.scss diff --git a/website/source/stylesheets/_styles.scss b/website/source/assets/stylesheets/_styles.scss similarity index 100% rename from website/source/stylesheets/_styles.scss rename to website/source/assets/stylesheets/_styles.scss diff --git a/website/source/stylesheets/bootstrap.min.css b/website/source/assets/stylesheets/bootstrap.min.css similarity index 100% rename from website/source/stylesheets/bootstrap.min.css rename to website/source/assets/stylesheets/bootstrap.min.css diff --git a/website/source/stylesheets/main.css.scss b/website/source/assets/stylesheets/main.css.scss similarity index 100% rename from website/source/stylesheets/main.css.scss rename to website/source/assets/stylesheets/main.css.scss diff --git a/website/source/stylesheets/prettify.css b/website/source/assets/stylesheets/prettify.css similarity index 100% rename from website/source/stylesheets/prettify.css rename to website/source/assets/stylesheets/prettify.css diff --git a/website/source/downloads.html.erb b/website/source/downloads.html.erb index 36f18d710..52c7cccff 100644 --- a/website/source/downloads.html.erb +++ b/website/source/downloads.html.erb @@ -17,19 +17,19 @@ page_title: "Downloads" Below are all available downloads for the latest version of Packer (<%= latest_version %>). Please download the proper package for your operating system and architecture. You can find SHA256 checksums - for packages here. + for packages here.

- <% $packer_os.each do |os| %> + <% product_versions.each do |os, versions| %>
-
<%= image_tag "/images/icons/icon_#{os}.png" %>
+
<%= system_icon(os) %>
-

<%= download_os_human(os) %>

+

<%= os %>

diff --git a/website/source/images/icons/icon_darwin.png b/website/source/images/icons/icon_darwin.png deleted file mode 100644 index c9ad9fe04..000000000 Binary files a/website/source/images/icons/icon_darwin.png and /dev/null differ diff --git a/website/source/images/icons/icon_freebsd.png b/website/source/images/icons/icon_freebsd.png deleted file mode 100644 index b5aad9299..000000000 Binary files a/website/source/images/icons/icon_freebsd.png and /dev/null differ diff --git a/website/source/images/icons/icon_linux.png b/website/source/images/icons/icon_linux.png deleted file mode 100644 index 7753dfb9e..000000000 Binary files a/website/source/images/icons/icon_linux.png and /dev/null differ diff --git a/website/source/images/icons/icon_openbsd.png b/website/source/images/icons/icon_openbsd.png deleted file mode 100644 index a9ee0423e..000000000 Binary files a/website/source/images/icons/icon_openbsd.png and /dev/null differ diff --git a/website/source/images/icons/icon_windows.png b/website/source/images/icons/icon_windows.png deleted file mode 100644 index d7748c009..000000000 Binary files a/website/source/images/icons/icon_windows.png and /dev/null differ diff --git a/website/source/index.html.erb b/website/source/index.html.erb index 4bb3a1d8b..3d4f3522e 100644 --- a/website/source/index.html.erb +++ b/website/source/index.html.erb @@ -27,7 +27,7 @@
- + <%= image_tag 'screenshots/vmware_and_virtualbox.png' %>
@@ -61,7 +61,7 @@
- + <%= image_tag 'screenshots/works_with.png' %>