Skip to content
Browse files

add paging to the blog

git-svn-id: http://svn.macosforge.org/repository/ruby/MacRubyWebsite/trunk@911 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
1 parent cdae8c0 commit 7560aa3745db6b9c0e1bd38e3f59103f6cc54228 @richkilmer richkilmer committed
Showing with 9 additions and 5 deletions.
  1. +6 −2 content/blog/index.txt
  2. +1 −1 content/blog/title_index.txt
  3. +2 −2 content/index.txt
View
8 content/blog/index.txt
@@ -5,13 +5,13 @@ dirty: true
filter:
- erb
---
-<a style="float:right" href="/blog/title_index.html">Summary Articles</a>
+<a style="float:right" href="/blog/title_index.html">Blog Overview</a>
<h1 class="title"> <%= h(@page.title) %> </h1>
<%
articles = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
:sort_by => "created_at", :reverse => true, :blog_post => true)
articles.delete(@page)
- paginate(articles, 10) do |page|
+ paginate(articles, 3) do |page|
-%>
<div class="article">
<div class="header">
@@ -26,3 +26,7 @@ filter:
</div>
</div>
<% end -%>
+<hr size="0" noshade class="doublerule" />
+<p style="text-align: center"><%= @pager.prev? ? "&laquo; "+link_to("newer", @pager.prev) : "<span style='color:#999'>&laquo; newer</span>" %> | Page <%= @pager.number %> of <%= @pager.number_of_pages %> | <%= @pager.next? ? link_to("older", @pager.next)+" &raquo;" : "<span style='color:#999'>older &raquo;</span>" %></p>
+
+
View
2 content/blog/title_index.txt
@@ -5,7 +5,7 @@ dirty: true
filter:
- erb
---
-<a style="float:right" href="/blog/index.html">Full Articles</a>
+<a style="float:right" href="/blog/index.html">Full Blog</a>
<h1 class="title"> <%= h(@page.title) %> </h1>
<%
articles = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
View
4 content/index.txt
@@ -9,7 +9,7 @@ filter:
<hr size="0" noshade class="harvardrule" />
<div id="newsbox">
- <h3><img src="/images/h3_macruby_blog.png" alt="MacRuby Blog" /></h3>
+ <h3><a href="/blog/index.html"><img src="/images/h3_macruby_blog.png" alt="MacRuby Blog" /></a></h3>
<%
articles = @pages.find(:all, :in_directory => File.join(@page.dir, 'blog'), :recursive => true,
@@ -21,7 +21,7 @@ filter:
<hr size="0" noshade class="doublerule" />
<% end -%>
- <a href="/blog/index.html"><img src="/images/h3_see-older-articles.png" alt="See Older Articles" /></a>
+ <a href="/blog/index2.html"><img src="/images/h3_see-older-articles.png" alt="See Older Articles" /></a>
</div><!-- //end newsbox -->

0 comments on commit 7560aa3

Please sign in to comment.
Something went wrong with that request. Please try again.