lib/alula/generators/paginate.rb in alula-0.4.6 vs lib/alula/generators/paginate.rb in alula-0.4.7

- old
+ new

@@ -1,7 +1,7 @@ module Alula - class Generator::Paginate < Generator + class Paginate < Generator def generate # Loop all languages and count posts per language @languages = {} self.site.content.posts.each do |post| post.languages.each do |lang| @@ -66,24 +66,9 @@ def substitutes(locale, item) { "page" => item.metadata.pagenum.to_s, } end - - # def generate_content - # # Generate pagination and pages - # num_posts = @site.content.posts.count - # pages = (num_posts / options.items).ceil - # - # (0..pages).each do |pagenum| - # pagename = "page#{pagenum}" - # - # @site.generated << Alula::Content::Page.new({ - # site: @site, - # posts: @site.content.posts.slice(options.items * pagenum, options.items), - # current_page: (pagenum + 1), - # name: pagename, - # }) - # end - # end end end + +Alula::Generator.register :paginate, Alula::Paginate