Sha256: 6a0279ba20b51b35ca9016d93c40ddc8931f34d99a6ed4c670a053c0ef7ae3bc

Contents?: true

Size: 422 Bytes

Versions: 9

Compression:

Stored size: 422 Bytes

Contents

module YariiEditor
  module Previewing
    extend ActiveSupport::Concern
        
    def preview_url
      "#{CurrentSite.site.preview_base_url}/#{preview_path}"
    end

    def preview_path
      # override in subclasses
      if respond_to?(:permalink) and permalink.present?
        permalink.sub(/^\//, '')
      else
        relative_path.sub(/^\//, '').sub(/\.md|\.html|\.markdown/, '')
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
yarii-editor-0.4.8 app/models/concerns/yarii_editor/previewing.rb
yarii-editor-0.4.7 app/models/concerns/yarii_editor/previewing.rb
yarii-editor-0.4.6 app/models/concerns/yarii_editor/previewing.rb
yarii-editor-0.4.5 app/models/concerns/yarii_editor/previewing.rb
yarii-editor-0.4.4 app/models/concerns/yarii_editor/previewing.rb
yarii-editor-0.4.3 app/models/concerns/yarii_editor/previewing.rb
yarii-editor-0.4.2 app/models/concerns/yarii_editor/previewing.rb
yarii-editor-0.4.1 app/models/concerns/yarii_editor/previewing.rb
yarii-editor-0.4.0 app/models/concerns/yarii_editor/previewing.rb