Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

First Cut at implementing all pages (index) (routed from '/v/all')

  • Loading branch information...
commit 6aa043e482be62984682b55538b3eb27aad69f90 1 parent e0494a6
@amit authored
View
6 lib/gollum/frontend/app.rb
@@ -42,6 +42,12 @@ class App < Sinatra::Base
show_page_or_file('Home')
end
+ get '/v/all/?$' do
+ wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
+ @pages = wiki.pages
+ mustache :allpages
+ end
+
get '/edit/*' do
@name = params[:splat].first
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
View
25 lib/gollum/frontend/templates/allpages.mustache
@@ -0,0 +1,25 @@
+<div class="guide">
+ <div class="main">
+ <div class="actions">
+ <form action="/search" method="get">
+ <div>
+ <a href="/">Home</a> |
+ <input type="search" name="q" size="10" /> <input type="submit" value="search" />
+ </div>
+ </form>
+ </div>
+ <h1>{{title}}</h1>
+ <div class="content wikistyle gollum {{format}}">
+ <ul>
+ {{#pages}}
+ <li><a href="/{{title}}">{{title}}</a></li>
+ {{/pages}}
+ </ul>
+ </div>
+ {{#has_footer}}
+ <div class="footer wikistyle gollum {{footer_format}}">
+ {{{footer_content}}}
+ </div>
+ {{/has_footer}}
+ </div>
+</div>
Please sign in to comment.
Something went wrong with that request. Please try again.