Sha256: a6feb94c26656b82e753cf9a0930e820cdbfa5907036557d34ef2b9b76afecfb

Contents?: true

Size: 458 Bytes

Versions: 3

Compression:

Stored size: 458 Bytes

Contents

module Gollum
  class Page
    # Add ".html" extension to page links
    def self.cname(name)
      cname = name.respond_to?(:gsub)      ?
      name.gsub(%r{[ /<>]}, '-') :
        ''
      cname + '.html'
    end

    def find(cname, version)
      name = cname[0..-6]
      if commit = @wiki.repo.commit(version)
        if page = find_page_in_tree(commit.tree, name)
          page.version = commit
          page
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gollum-site-0.0.3 lib/gollum-site/page.rb
gollum-site-0.0.2 lib/gollum-site/page.rb
gollum-site-0.0.1 lib/gollum-site/page.rb