Skip to content

Commit

Permalink
only render header when asset_host is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Wiggins committed Mar 30, 2009
1 parent 66b84fd commit ab0c5f3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
5 changes: 4 additions & 1 deletion docs.rb
Expand Up @@ -19,12 +19,15 @@
end

get '/css/docs.css' do
@asset_host = ENV['ASSET_HOST']
cache_long
content_type 'text/css'
erb :css, :layout => false
end

before do
@asset_host = ENV['ASSET_HOST']
end

helpers do
def render_topic(topic)
source = File.read(topic_file(topic))
Expand Down
22 changes: 12 additions & 10 deletions views/layout.erb
Expand Up @@ -9,16 +9,18 @@
<body>
<div id="bodywrap">

<div id="header">
<a id="logo" href="http://heroku.com/">Heroku</a>
<ul>
<li><a href="http://heroku.com/how">How it Works</a></li>
<li><a href="http://heroku.com/docs" class="active">Docs</a></li>
<li><a href="http://blog.heroku.com/">Blog</a></li>
<li><a href="http://heroku.com/about">About</a></li>
<li><a href="http://heroku.com/login">Login</a></li>
</ul>
</div>
<% if @asset_host %>
<div id="header">
<a id="logo" href="http://heroku.com/">Heroku</a>
<ul>
<li><a href="http://heroku.com/how">How it Works</a></li>
<li><a href="http://heroku.com/docs" class="active">Docs</a></li>
<li><a href="http://blog.heroku.com/">Blog</a></li>
<li><a href="http://heroku.com/about">About</a></li>
<li><a href="http://heroku.com/login">Login</a></li>
</ul>
</div>
<% end %>

<ul id="docsnav">
<li class="title"><a href="/">Heroku Docs</a></li>
Expand Down

0 comments on commit ab0c5f3

Please sign in to comment.