Sha256: a48456955dd8e1226cdccfdbbec54eb68a027c43a77dccc26bf6c6beaf71558b

Contents?: true

Size: 796 Bytes

Versions: 24

Compression:

Stored size: 796 Bytes

Contents

require "rails/application_controller"

module Lookbook
  class PageController < Rails::ApplicationController
    helper UiElementsHelper
    helper PageHelper

    Lookbook.config.page_paths.each do |path|
      prepend_view_path Rails.root.join(path)
    end

    def render_page(page, locals = {})
      @page = page
      @pages = Engine.pages
      @next_page = @pages.next(@page)
      @previous_page = @pages.previous(@page)

      content = ActionViewAnnotationsHandler.call(disable_annotations: true) do
        render_to_string inline: @page.content, locals: {
          page: @page,
          next_page: @next_page,
          previous_page: @previous_page,
          pages: @pages
        }
      end

      @page.markdown? ? MarkdownRenderer.call(content) : content
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
lookbook-2.2.2 app/controllers/lookbook/page_controller.rb
lookbook-2.2.1 app/controllers/lookbook/page_controller.rb
lookbook-2.2.0 app/controllers/lookbook/page_controller.rb
lookbook-2.1.1 app/controllers/lookbook/page_controller.rb
lookbook-2.1.0 app/controllers/lookbook/page_controller.rb
lookbook-2.0.5 app/controllers/lookbook/page_controller.rb
lookbook-2.0.4 app/controllers/lookbook/page_controller.rb
lookbook-2.0.3 app/controllers/lookbook/page_controller.rb
lookbook-2.0.2 app/controllers/lookbook/page_controller.rb
lookbook-2.0.1 app/controllers/lookbook/page_controller.rb
lookbook-2.0.0 app/controllers/lookbook/page_controller.rb
lookbook-2.0.0.rc.3 app/controllers/lookbook/page_controller.rb
lookbook-2.0.0.rc.2 app/controllers/lookbook/page_controller.rb
lookbook-2.0.0.rc.1 app/controllers/lookbook/page_controller.rb
lookbook-2.0.0.beta.9 app/controllers/lookbook/page_controller.rb
lookbook-2.0.0.beta.8 app/controllers/lookbook/page_controller.rb
lookbook-2.0.0.beta.7 app/controllers/lookbook/page_controller.rb
lookbook-2.0.0.beta.6 app/controllers/lookbook/page_controller.rb
lookbook-2.0.0.beta.5 app/controllers/lookbook/page_controller.rb
lookbook-2.0.0.beta.4 app/controllers/lookbook/page_controller.rb