Skip to content

Commit

Permalink
Refresh the Tutorials!
Browse files Browse the repository at this point in the history
This replaces the Tutorials section of the Habitat web site with a newer, shinier one
with a lot more excellent content.

Signed-off-by: Christian Nunciato <cnunciato@chef.io>
  • Loading branch information
Christian Nunciato committed Aug 4, 2017
1 parent fdfd07e commit f79d4b6
Show file tree
Hide file tree
Showing 197 changed files with 12,543 additions and 2,972 deletions.
2 changes: 1 addition & 1 deletion www/Makefile
@@ -1,6 +1,6 @@
build: clean
bundle install
bundle exec middleman build
bundle exec middleman build --no-parallel
.PHONY: build

clean:
Expand Down
110 changes: 64 additions & 46 deletions www/config.rb
Expand Up @@ -3,6 +3,7 @@
activate :syntax
set :markdown_engine, :kramdown
set :markdown, coderay_line_numbers: :table

###
# Page options, layouts, aliases and proxies
###
Expand All @@ -13,45 +14,40 @@
page '/*.xml', layout: false
page '/*.json', layout: false
page '/*.txt', layout: false
page '/blog/feed.xml', layout: false

# With alternative layout
page 'about/*', layout: :sidebar, locals: { sidebar_layout: 'about' }
page 'tutorials/getting-started/linux/*', layout: :sidebar, locals: { sidebar_layout: 'linux_tutorial' }
page 'tutorials/getting-started/windows/*', layout: :sidebar, locals: { sidebar_layout: 'windows_tutorial' }
page 'tutorials/*', layout: :sidebar, locals: { sidebar_layout: 'tutorials' }
page 'docs/*', layout: :sidebar, locals: { sidebar_layout: 'docs' }
page 'legal/*', layout: :sidebar, locals: { sidebar_layout: 'legal' }
page 'try/*', layout: :try
page 'tutorials/index.html', layout: :tutorials
page 'tutorials/get-started/*', layout: :tutorials_sidebar, locals: { sidebar_layout: 'get_started' }
page 'tutorials/download/*', layout: :tutorials_sidebar, locals: { sidebar_layout: 'download' }
page 'tutorials/sample-app/linux/*', layout: :tutorials_sidebar, locals: { sidebar_layout: 'sample_app_linux' }
page 'tutorials/sample-app/windows/*', layout: :tutorials_sidebar, locals: { sidebar_layout: 'sample_app_windows' }
page 'tutorials/sample-app/mac/*', layout: :tutorials_sidebar, locals: { sidebar_layout: 'sample_app_mac' }
page 'tutorials/sample-app/*', layout: :tutorials_sidebar, locals: { sidebar_layout: 'sample_app' }
page '/blog/index.html', layout: :blog_index

activate :blog do |blog|
blog.prefix = "blog"
blog.prefix = 'blog'
blog.layout = 'layouts/blog_post'
blog.permalink = "{year}/{month}/{title}.html"
blog.default_extension = ".md"
blog.permalink = '{year}/{month}/{title}.html'
blog.default_extension = '.md'
blog.summary_separator = /READMORE/
blog.summary_length = 250
blog.paginate = true
blog.per_page = 10
blog.page_link = "page/{num}"
blog.taglink = ":tag.html"
blog.tag_template = "blog/tag.html"
blog.calendar_template = "blog/calendar.html"
blog.page_link = 'page/{num}'
blog.taglink = ':tag.html'
blog.tag_template = 'blog/tag.html'
blog.calendar_template = 'blog/calendar.html'
end

# Proxy pages (http://middlemanapp.com/basics/dynamic-pages/)
# proxy '/this-page-has-no-template.html', '/template-file.html', locals: {
# which_fake_page: 'Rendering a fake page with a local variable' }

###
# Helpers
###

# Reload the browser automatically whenever files change
configure :development do
activate :livereload
end

# Methods defined in the helpers block are available in templates
require 'lib/sidebar_helpers'
require 'lib/blog_helpers'
Expand All @@ -69,34 +65,36 @@ def layout_class
'blogs'
elsif layout == :blog_index
'has-sidebar'
elsif layout == :tutorials
'tutorials'
else
''
end
end

def path_starts_with?(path)
current_page.path.start_with?(path)
end

def builder_web_url
ENV["BUILDER_WEB_URL"] || "https://bldr.habitat.sh"
ENV['BUILDER_WEB_URL'] || 'https://bldr.habitat.sh'
end

def render_markdown(text)
Kramdown::Document.new(text).to_html
end
end

page "/blog/feed.xml", layout:false
# Build-specific configuration
configure :build do
# Minify CSS on build
#activate :minify_css
configure :development do

# Minify Javascript on build
#activate :minify_javascript
# Reload the browser automatically whenever files change
activate :livereload
end

configure :build do

# Asset hash to defeat caching between builds
activate :asset_hash

# Minify HTML on build
#activate :minify_html
end

activate :autoprefixer
Expand All @@ -106,23 +104,43 @@ def render_markdown(text)

activate :s3_sync do |s3_sync|
s3_sync.path_style = false
s3_sync.region = ENV["AWS_DEFAULT_REGION"]
s3_sync.region = ENV['AWS_DEFAULT_REGION']
end

###
# Redirects
###
# Temporarily changes the default redirect (from /about
# index to 'Why Habitat' article) to a livestream page
# redirect 'about/index.html', to: 'about/why-habitat.html'
redirect 'about/index.html', to: 'about/announcement.html'
redirect 'docs/index.html', to: 'docs/overview.html'
redirect 'docs/build-packages-overview.html', to: 'docs/create-packages-build.html'
redirect 'tutorials/getting-started-overview.html', to: 'tutorials/getting-started/overview.html'
redirect 'tutorials/getting-started-basic-concepts.html', to: 'tutorials/getting-started/mac/basic-concepts.html'
redirect 'tutorials/getting-started-setup-environment.html', to: 'tutorials/getting-started/mac/setup-environment.html'
redirect 'tutorials/getting-started-review-source-files.html', to: 'tutorials/getting-started/mac/create-plan.html'
redirect 'tutorials/getting-started-create-plan.html', to: 'tutorials/getting-started/mac/create-plan.html'
redirect 'tutorials/getting-started-add-hooks.html', to: 'tutorials/getting-started/mac/add-hooks.html'
redirect 'tutorials/getting-started-configure-plan.html', to: 'tutorials/getting-started/mac/configure-plan.html'
redirect 'tutorials/getting-started-process-build.html', to: 'tutorials/getting-started/mac/process-build.html'
redirect 'about/index.html', to: '/about/announcement/'
redirect 'docs/build-packages-overview.html', to: '/docs/create-packages-build/'
redirect 'docs/get-habitat.html', to: '/tutorials/download/'
redirect 'download/index.html', to: '/tutorials/download/'
redirect 'downloads/index.html', to: '/tutorials/download/'
redirect 'try/index.html', to: '/tutorials/get-started/demo/'
redirect 'try/index.html', to: '/tutorials/'
redirect 'try/2/index.html', to: '/tutorials/'
redirect 'try/3/index.html', to: '/tutorials/'
redirect 'try/4/index.html', to: '/tutorials/'
redirect 'try/5/index.html', to: '/tutorials/'
redirect 'try/6/index.html', to: '/tutorials/'
redirect 'try/7/index.html', to: '/tutorials/'
redirect 'try/8/index.html', to: '/tutorials/'
redirect 'try/9/index.html', to: '/tutorials/'
redirect 'try/10/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/linux/add-hooks/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/linux/basic-concepts/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/linux/create-plan/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/linux/configure-plan/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/linux/process-build/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/linux/setup-environment/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/mac/add-hooks/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/mac/basic-concepts/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/mac/create-plan/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/mac/configure-plan/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/mac/process-build/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/mac/setup-environment/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/windows/add-hooks/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/windows/basic-concepts/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/windows/create-plan/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/windows/configure-plan/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/windows/process-build/index.html', to: '/tutorials/'
redirect 'tutorials/getting-started/windows/setup-environment/index.html', to: '/tutorials/'
6 changes: 3 additions & 3 deletions www/data/docs_sidebar.yml
Expand Up @@ -4,8 +4,8 @@ sidebar_links:
links:
- title: Overview
link: "/docs/overview/"
- title: Get Habitat
link: "/docs/get-habitat/"
- title: Download and install Habitat
link: "/tutorials/download/"
- title: Tutorials
link: "/tutorials/"
- title: Concepts <span>&plus;</span>
Expand Down Expand Up @@ -102,7 +102,7 @@ sidebar_links:
- title: Supervisor log keys
link: "/docs/reference/log-keys/"
- title: Habitat infographics
link: "/docs/reference/habitat-infographics/"
link: "/docs/reference/habitat-infographics/"
- title: Contribute
links:
- title: Help build Habitat
Expand Down
12 changes: 12 additions & 0 deletions www/data/download_sidebar.yml
@@ -0,0 +1,12 @@
---
sidebar_links:
- title: Download &amp; Install
links:
- title: Install the Habitat CLI
link: /tutorials/download/
- title: Create a Habitat Account
link: /tutorials/download/create-account/
- title: Create an Origin
link: /tutorials/download/create-origin/
- title: Configure Your Workstation
link: /tutorials/download/configure-workstation/
30 changes: 30 additions & 0 deletions www/data/get_started_sidebar.yml
@@ -0,0 +1,30 @@
---
sidebar_links:
- title: Get Started
links:
- title: Introduction to Habitat
link: /tutorials/get-started
sub_links:
- title: Getting Started with Habitat
link: /tutorials/get-started/videos/getting-started/
icon: 'play-video'
- title: Habitat in Production
link: /tutorials/get-started/videos/habitat-in-production/
icon: 'play-video'
- title: Interactive Demo
link: /tutorials/get-started/demo/
sub_links:
- title: Start Up Services
link: /tutorials/get-started/demo/start-services/
- title: Join Services Together
link: /tutorials/get-started/demo/join-services/
- title: Dynamically Configure Services
link: /tutorials/get-started/demo/configure-services/
- title: Set Up a Service Group Topology
link: /tutorials/get-started/demo/set-up-topology/
- title: Add Services to a Group
link: /tutorials/get-started/demo/add-services-to-group/
- title: Check the Health of a Service
link: /tutorials/get-started/demo/check-service-health/
- title: Learn More About Habitat
link: /tutorials/get-started/demo/learn-more/
31 changes: 0 additions & 31 deletions www/data/linux_tutorial_sidebar.yml

This file was deleted.

23 changes: 23 additions & 0 deletions www/data/sample_app_linux_sidebar.yml
@@ -0,0 +1,23 @@
---
sidebar_links:
- title: Build a Sample App
links:
- title: Introduction
link: /tutorials/sample-app/
sub_links:
- title: Basic Concepts
link: /tutorials/sample-app/basic-concepts/
- title: Create a Plan with Scaffolding
link: /tutorials/sample-app/linux/
- title: Add Health Monitoring to a Plan
link: /tutorials/sample-app/linux/add-health-check-hook/
- title: Build the Package
link: /tutorials/sample-app/linux/build-package/
- title: Run the Sample App
link: /tutorials/sample-app/linux/run-app/
- title: Dynamically Update the App
link: /tutorials/sample-app/linux/update-app/
- title: Upload the Sample App
link: /tutorials/sample-app/linux/upload-package/
- title: Next Steps
link: /tutorials/sample-app/next-steps/
23 changes: 23 additions & 0 deletions www/data/sample_app_mac_sidebar.yml
@@ -0,0 +1,23 @@
---
sidebar_links:
- title: Build a Sample App
links:
- title: Introduction
link: /tutorials/sample-app/
sub_links:
- title: Basic Concepts
link: /tutorials/sample-app/basic-concepts/
- title: Create a Plan with Scaffolding
link: /tutorials/sample-app/mac/
- title: Add Health Monitoring to a Plan
link: /tutorials/sample-app/mac/add-health-check-hook/
- title: Build the Package
link: /tutorials/sample-app/mac/build-package/
- title: Run the Sample App
link: /tutorials/sample-app/mac/run-app/
- title: Dynamically Update the App
link: /tutorials/sample-app/mac/update-app/
- title: Upload the Sample App
link: /tutorials/sample-app/mac/upload-package/
- title: Next Steps
link: /tutorials/sample-app/next-steps/
23 changes: 23 additions & 0 deletions www/data/sample_app_sidebar.yml
@@ -0,0 +1,23 @@
---
sidebar_links:
- title: Build a Sample App
links:
- title: Introduction
link: /tutorials/sample-app/
sub_links:
- title: Basic Concepts
link: /tutorials/sample-app/basic-concepts/
- title: Create a Plan with Scaffolding
link: /tutorials/sample-app/mac/
- title: Add Health Monitoring to a Plan
link: /tutorials/sample-app/mac/add-health-check-hook/
- title: Build the Package
link: /tutorials/sample-app/mac/build-package/
- title: Run the Sample App
link: /tutorials/sample-app/mac/run-app/
- title: Dynamically Update the App
link: /tutorials/sample-app/mac/update-app/
- title: Upload the Sample App
link: /tutorials/sample-app/mac/upload-package/
- title: Next Steps
link: /tutorials/sample-app/next-steps/
23 changes: 23 additions & 0 deletions www/data/sample_app_windows_sidebar.yml
@@ -0,0 +1,23 @@
---
sidebar_links:
- title: Build a Sample App
links:
- title: Introduction
link: /tutorials/sample-app/
sub_links:
- title: Basic Concepts
link: /tutorials/sample-app/basic-concepts/
- title: Create a Plan with Scaffolding
link: /tutorials/sample-app/windows/
- title: Add Health Monitoring to a Plan
link: /tutorials/sample-app/windows/add-health-check-hook/
- title: Build the Package
link: /tutorials/sample-app/windows/build-package/
- title: Run the Sample App
link: /tutorials/sample-app/windows/run-app/
- title: Dynamically Update the App
link: /tutorials/sample-app/windows/update-app/
- title: Upload the Sample App
link: /tutorials/sample-app/windows/upload-package/
- title: Next Steps
link: /tutorials/sample-app/next-steps/

0 comments on commit f79d4b6

Please sign in to comment.