lib/alula/generators/paginate.rb in alula-0.4.0b vs lib/alula/generators/paginate.rb in alula-0.4.0

- old
+ new

@@ -32,30 +32,31 @@ pagenum: (page + 1), pages: (pages + 1), title: titles, name: "page-#{(page + 1)}", slug: "page-#{(page + 1)}", + sidebar: false, template: self.options.template, site: self.site, view: self.options.view || "paginate", }, - :previous => ->(locale) { + :previous => ->(hook, locale) { pos = self.navigation(locale).index(self) if pos and pos < (self.navigation(locale).count - 1) self.navigation(locale)[pos + 1] else nil end }, - :next => ->(locale) { + :next => ->(hook, locale) { pos = self.navigation(locale).index(self) if pos and pos > 0 self.navigation(locale)[pos - 1] else nil end }, - :navigation => ->(locale) { + :navigation => ->(hook, locale) { locale ||= self.current_locale || self.site.config.locale @navigation[locale] ||= self.site.content.pages.select { |item| item.metadata.generator == self.generator and item.languages.include?(locale) } } ) end