Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Made the archived downloads better readable #76

Merged
merged 7 commits into from
Dec 15, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Rules
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ compile '/news/*/' do
layout 'default'
end

compile '/includes/header*' do
layout 'header'
end

compile '/includes/footer*' do
layout 'footer'
end

# .htaccess does get filtered with erb, but without layout.
compile %r{^/(htaccess)/$} do
filter :erb
Expand Down
3 changes: 1 addition & 2 deletions content/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ <h3>Which Operating System?</h3>
<h3>Which Build?</h3>
<p>Release builds are recommended for most players.<br />They have been extensively tested and have a larger player base.</p>
<p>Playtest builds contain the latest improvements, but change frequently and may be broken at times.</p>
<p>Older releases can be <a href=<%= DOWNLOAD_BASE_PATH%>>found here</a>.</p>

<% PLATFORMS.each do |platform| %>
<div id="<%= platform %>" class="tab">
<hr />
Expand All @@ -69,6 +67,7 @@ <h3>Download OpenRA <%= "for " unless platform == "source" %> <%= PLATFORM_NAME[
<li><a href="<%= package_url(platform, RELEASE_TAG) %>" title="Download <%= RELEASE_TAG %>">Download <%= RELEASE_TAG %><br />(<%= package_size(platform, RELEASE_TAG) %>)</a></li>
<li><a href="<%= package_url(platform, PLAYTEST_TAG) %>" title="Download <%= PLAYTEST_TAG %>">Download <%= PLAYTEST_TAG %><br />(<%= package_size(platform, PLAYTEST_TAG) %>)</a></li>
</ul>
<p>Older releases can be found in our <a href="<%= DOWNLOAD_BASE_PATH + package_path(platform) %>">package archive</a>.</p>
<% end %>
</div>
<% end %>
24 changes: 20 additions & 4 deletions content/htaccess.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# Custom file not found sub-page
ErrorDocument 404 /404/

<% if @site.config[:redirects] %>
# Set up URL redirects<% @site.config[:redirects].each do |h| %>
Redirect 301 <%= h[:from] %> <%= h[:to] %>
<% end %><% end %>
# Format the /assets/downloads/ folders properly
IndexOptions FancyIndexing VersionSort XHTML NameWidth=* SuppressDescription
IndexStyleSheet /style.css
HeaderName /includes/header/index.html
ReadmeName /includes/footer/index.html

# Point old download URLs to new overview
RedirectMatch 301 ^/download/osx/* /download/#osx
RedirectMatch 301 ^/download/linux/arch/* /download/#arch
RedirectMatch 301 ^/download/linux/deb/* /download/#deb
RedirectMatch 301 ^/download/linux/rpm/* /download/#rpm
RedirectMatch 301 ^/download/linux/* /download/#deb
RedirectMatch 301 ^/download/win/* /download/#win

# Point old URLs from the Silverstripe CMS website to new counterparts
Redirect 301 /index.php /
Redirect 301 /news/rss /news/atom
Redirect 301 /themes/openra/images /images
Redirect 301 /assets/images /images
Redirect 301 /master/ping.php http://master.open-ra.org/ping.php
Empty file added content/includes/footer.html
Empty file.
3 changes: 3 additions & 0 deletions content/includes/footer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: "Archived Downloads"
---
1 change: 1 addition & 0 deletions content/includes/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h3>Archived Downloads</h3>
3 changes: 3 additions & 0 deletions content/includes/header.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
title: "Archived Downloads"
---
5 changes: 5 additions & 0 deletions content/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,8 @@ td, th, tr {
.downloadblurb {
min-height: 50px;
}

pre {
font-weight: normal;
font-family: monospace;
}
15 changes: 1 addition & 14 deletions layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
<%
PAGES = ["/", "/news/", "/download/", "/games/", "/get-involved/"]
PAGE_TITLES = {
"/" => "Home",
"/news/" => "News",
"/download/" => "Download",
"/games/" => "Games",
"/get-involved/" => "Support / Contribute"
}

def navigation_page(page)
page == @item.path || (page == "/news/" && @item.path.start_with?("/news/"))
end
%><!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
Expand Down
3 changes: 3 additions & 0 deletions layouts/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
</div>
<div id="footer"><p>Copyright &copy; 2007-2013 The OpenRA Developers (<a href="/legal/">Legal notices</a>)</p></div>
</div>
10 changes: 10 additions & 0 deletions layouts/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div id="container">
<div id="header"><h1><img src="/images/soviet-logo.svg" />OpenRA</h1></div>
<a id="ghbanner" href="https://github.com/OpenRA/OpenRA"><img src="/images/forkme.svg" alt="Fork me on GitHub"></a>
<ul id="nav">
<% PAGES.each do |page| %>
<li><a href="<%= page %>"<%= ' class="nav-selected"' if navigation_page(page) %>><%= PAGE_TITLES[page] %></a></li>
<% end %>
</ul>
<div id="content">
<%= yield %>
46 changes: 39 additions & 7 deletions lib/openra.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,43 @@ def package_name(platform, tag)
modtag = tag.gsub('-', '.')
case platform
when "osx"
"mac/OpenRA-#{tag}.zip"
"OpenRA-#{tag}.zip"
when "win"
"windows/OpenRA-#{tag}.exe"
"OpenRA-#{tag}.exe"
when "arch"
"linux/arch/openra-#{modtag}-1-any.pkg.tar.xz"
"openra-#{modtag}-1-any.pkg.tar.xz"
when "deb"
"linux/deb/openra_#{modtag}_all.deb"
"openra_#{modtag}_all.deb"
when "rpm"
"linux/rpm/openra-#{modtag}-1.noarch.rpm"
"openra-#{modtag}-1.noarch.rpm"
when "source"
"source/#{tag}.tar.gz"
"#{tag}.tar.gz"
else
raise "Why is your platform #{platform}?!?!"
end
end

def package_url(platform, tag)
DOWNLOAD_BASE_PATH + package_name(platform, tag)
DOWNLOAD_BASE_PATH + package_path(platform) + package_name(platform, tag)
end

def package_path(platform)
case platform
when "osx"
"mac/"
when "win"
"windows/"
when "arch"
"linux/arch/"
when "deb"
"linux/deb/"
when "rpm"
"linux/rpm/"
when "source"
"source/"
else
raise "Why is your platform #{platform}?!?!"
end
end

def package_size(platform, tag)
Expand All @@ -65,3 +84,16 @@ def package_size(platform, tag)
def pretty_date(date)
attribute_to_time(date).strftime("%Y-%m-%d")
end

PAGES = ["/", "/news/", "/download/", "/games/", "/get-involved/"]
PAGE_TITLES = {
"/" => "Home",
"/news/" => "News",
"/download/" => "Download",
"/games/" => "Games",
"/get-involved/" => "Support / Contribute"
}

def navigation_page(page)
page == @item.path || (page == "/news/" && @item.path.start_with?("/news/"))
end
45 changes: 0 additions & 45 deletions nanoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,51 +76,6 @@ watcher:
notify_on_compilation_success: true
notify_on_compilation_failure: true

# Point old URLs from the Silverstripe CMS website to new counterparts
redirects:
-
from: /index.php
to: /
-
from: /download/linux
to: /download
-
from: /download/arch
to: /download/#arch
-
from: /download/deb
to: /download/#deb
-
from: /download/rpm
to: /download/#rpm
-
from: /download/osx
to: /download/#osx
-
from: /download/win
to: /download/#win
-
from: /download/release
to: /download/
-
from: /download/playtest
to: /download/
-
from: /download/latest
to: /download/
-
from: /news/rss
to: /news/atom
-
from: /themes/openra/images
to: /images
-
from: /assets/images
to: /images
-
from: /master/ping.php
to: http://master.open-ra.org/ping.php

deploy:
res0l:
kind: rsync
Expand Down