Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add CHANGELOG to genghisapp.com

  • Loading branch information...
commit 894aba95480fd4e1f81dd9ac80fcf8f47829f852 1 parent fd98801
@bobthecow authored
View
4 Gemfile
@@ -4,7 +4,7 @@ gem 'nanoc'
gem 'nanoc-git'
gem 'typogruby'
gem 'kramdown'
-gem 'therubyracer'
+gem 'therubyracer', '0.11.0'
gem 'less'
gem 'uglifier'
gem 'rainpress'
@@ -17,4 +17,4 @@ group :development do
gem 'bson_ext', require: false
gem 'pry'
gem 'faker'
-end
+end
View
8 Gemfile.lock
@@ -21,7 +21,6 @@ GEM
kramdown (0.14.0)
less (2.2.2)
commonjs (~> 0.2.6)
- libv8 (3.3.10.4)
method_source (0.8.1)
mime-types (1.19)
mongo (1.7.0)
@@ -38,10 +37,11 @@ GEM
slop (~> 3.3.1)
rack (1.4.1)
rainpress (1.0)
+ ref (1.0.2)
rubypants (0.2.0)
slop (3.3.3)
- therubyracer (0.10.2)
- libv8 (~> 3.3.10)
+ therubyracer (0.11.0)
+ ref
typogruby (1.0.15)
rubypants
uglifier (1.3.0)
@@ -64,6 +64,6 @@ DEPENDENCIES
nanoc-git
pry
rainpress
- therubyracer
+ therubyracer (= 0.11.0)
typogruby
uglifier
View
22 Rules
@@ -1,14 +1,10 @@
#!/usr/bin/env ruby
preprocess do
- get_genghis_version
+ config[:genghis_version] = get_genghis_version
end
-# passthrough '/CNAME/' ## Currently borken
-compile '/CNAME/' do; end
-route '/CNAME/' do
- '/CNAME'
-end
+passthrough '/CNAME/'
compile '/script/' do
filter :erb
@@ -49,6 +45,20 @@ route '/404/' do
'/404.html'
end
+compile '/changelog/' do
+ filter :erb
+ layout 'default'
+end
+route '/changelog/' do
+ '/changelog/index.html'
+end
+
+compile '/changelog/*' do
+ filter :kramdown
+ filter :github_issue_links, project: 'bobthecow/genghis'
+end
+route '/changelog/*' do; end
+
compile '*' do
if item.binary?
# don’t filter binary items
View
7 config.yaml
@@ -4,9 +4,10 @@ index_filenames: [ 'index.html' ]
enable_output_diff: true
data_sources:
- - type: filesystem_unified
- items_root: /
- layouts_root: /
+ - type: filesystem_unified
+ items_root: /
+ - type: changelog
+ items_root: /changelog/
watcher:
dirs_to_watch: [ 'content', 'layouts', 'lib' ]
View
13 content/changelog.html.erb
@@ -0,0 +1,13 @@
+---
+title: Genghis Changelog
+---
+<h1>Changelog</h1>
+
+<ul id="changelog">
+ <% changes.each do |version| %>
+ <li id="<%= version_hash(version[:version]) %>">
+ <h3>v<%= version[:version] %></h3>
+ <%= version.compiled_content %>
+ </li>
+ <% end %>
+</ul>
View
6 content/index.html.erb
@@ -5,12 +5,12 @@ title: Genghis, the single-file MongoDB admin app.
<li>
<input value="gem install genghisapp" autocorrect="off" autocomplete="off" readonly="true">
<span>or</span>
- <a class="download" href="https://github.com/downloads/bobthecow/genghis/genghis-<%= item[:genghis_version] %>.tgz" title="Genghis v<%= item[:genghis_version] %>">Download</a>
+ <a class="download" href="https://github.com/downloads/bobthecow/genghis/genghis-<%= @config[:genghis_version] %>.tgz" title="Genghis v<%= @config[:genghis_version] %>">Download</a>
</li>
<li><a href="https://github.com/bobthecow/genghis#readme">Docs</a></li>
- <li><a href="https://github.com/bobthecow/genghis/blob/master/CHANGELOG.markdown#v<%= item[:genghis_version].gsub('.', '') %>">Changes</a></li>
+ <li><a href="/changelog/">Changes</a></li>
<li><a href="https://github.com/bobthecow/genghis/issues">Issues</a></li>
- <li><span>Version <%= item[:genghis_version] %></span></li>
+ <li><span>Version <%= @config[:genghis_version] %></span></li>
</nav>
<ul id="screenshots">
View
86 content/style/content.less
@@ -57,7 +57,7 @@ html {
}
}
-header h1, footer p, html.item-404 section#main {
+header h1, footer p, html.item-404 section#main, html.item-changelog section#main h1 {
font-family: "Rokkitt";
}
@@ -98,6 +98,18 @@ header {
font-family: 'Rokkitt';
margin: 0;
font-size: @72px;
+ a {
+ .transition(text-shadow .2s ease-in-out);
+ &:link, &:visited {
+ font-weight: bold;
+ color: #FFF;
+ text-decoration: none;
+ }
+ &:hover, &:active {
+ text-decoration: none;
+ text-shadow: 0 0 @8px fadeout(@mongoGreen, 40%);
+ }
+ }
}
h2 {
margin: 0;
@@ -327,6 +339,78 @@ html.item-404 {
}
}
+#changelog {
+ text-align: left;
+ width: 240*@px;
+ margin: @12px auto 0;
+ padding-bottom: @24px;
+
+ h3 {
+ margin: @16px 0 @8px;
+ color: @black;
+ font-size: @12px;
+ font-weight: bold;
+ }
+
+ p {
+ margin: @4px 0;
+ }
+
+ ul {
+ margin-left: @12px;
+ }
+
+ > ul {
+ margin: @8px 0 @8px @12px;
+ }
+
+ ul {
+ li {
+ margin: @3px 0;
+
+ &:before {
+ font-weight: bold;
+ font-size: 66%;
+ content: '\2605';
+ color: lighten(desaturate(@mongoGreen, 50%), 25%);
+ margin: 0 .5em 0 -1.5em;
+ }
+ }
+ }
+}
+
+html.item-changelog {
+ body {
+ padding-bottom: 0;
+ }
+
+ section#main {
+ margin-top: @24px;
+ background-color: #fff;
+ color: @lightBlack;
+
+ h1 {
+ text-align: left;
+ color: @grey;
+ font-size: @24px;
+ font-weight: bold;
+ width: 240*@px;
+ margin: 0 auto;
+ padding-top: @24px;
+ }
+ }
+
+ #share {
+ display: none;
+ }
+
+ footer {
+ position: inherit;
+ .box-shadow(none);
+ border-top-color: darken(@bg, 15%);
+ }
+}
+
#share {
padding: @8px @16px;
margin-bottom: @4px;
View
2  layouts/default.erb
@@ -15,7 +15,7 @@
</head>
<body lang="en">
<header>
- <h1>Genghis</h1>
+ <h1><a href="/">Genghis</a></h1>
<h2>The single-file MongoDB admin app.</h2>
</header>
View
29 lib/data_sources/changelog.rb
@@ -0,0 +1,29 @@
+class ChangelogDataSource < Nanoc::DataSource
+ identifier :changelog
+
+ CHANGELOG = 'https://raw.github.com/bobthecow/genghis/master/CHANGELOG.markdown'
+
+ def up
+ require 'open-uri'
+ end
+
+ def items
+ items = []
+ lines = open(CHANGELOG).read.split(/(?:^|\n\n\n)## (v[\d\.]+)\n\n/)
+ lines.shift
+ lines.each_slice(2) do |version, changes|
+ items << Nanoc::Item.new(
+ changes,
+ {
+ kind: 'changelog',
+ version: version.sub(/^v/, ''),
+ is_hidden: true,
+ },
+ version
+ )
+ end
+
+ items
+ end
+end
+
View
15 lib/default.rb
@@ -7,11 +7,20 @@ def item_slug(item=nil)
end
def screenshots
- @items.select {|i| i.identifier =~ /^\/screenshots\/./ && i[:extension] == 'png' }
+ @items.select {|i| i.identifier =~ %r{^/screenshots/.} && i[:extension] == 'png' }
end
def get_genghis_version
require 'open-uri'
- index = @items.find {|i| i.identifier == '/' }
- index[:genghis_version] = open('https://raw.github.com/bobthecow/genghis/master/VERSION').read
+ open('https://raw.github.com/bobthecow/genghis/master/VERSION').read
end
+
+def changes
+ @items.select { |i| i.identifier =~ %r{^/changelog/.} }.sort do |a, b|
+ Gem::Version.new(b[:version].dup) <=> Gem::Version.new(a[:version].dup)
+ end
+end
+
+def version_hash(version)
+ version.gsub(/[^\w]+/, '_').sub(/^v?/, 'v')
+end
View
14 lib/filters/github_issue_links.rb
@@ -0,0 +1,14 @@
+module Nanoc3::Filters
+
+ class GithubIssueLinks < Nanoc3::Filter
+
+ identifiers :github_issue_links
+
+ def run(content, opts={})
+ project = opts[:project] || 'bobthecow/genghis'
+ base_url = "https://github.com/#{project}/issues/"
+ content.gsub(/\b(?:(?:Fix|See) )?#(\d+)\b/, "<a href=\"#{base_url}\\1\">\\0</a>")
+ end
+
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.