Sha256: b3bf89cf5f7c23ce5d419b5806b12a825ea6d5cde8fad7685482a0c9a3e209e7

Contents?: true

Size: 338 Bytes

Versions: 30

Compression:

Stored size: 338 Bytes

Contents

module PageHelper
  def link_to_page(page)
    link_to page.data.fetch("title", page.request_path), page.request_path
  end

  def link_to_if_current(text, page, active_class: "active")
    if page == current_page
      link_to text, page.request_path, class: active_class
    else
      link_to text, page.request_path
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
sitepress-cli-4.0.8 templates/default/helpers/page_helper.rb
sitepress-cli-4.0.7 templates/default/helpers/page_helper.rb
sitepress-cli-4.0.6 templates/default/helpers/page_helper.rb
sitepress-cli-4.0.5 templates/default/helpers/page_helper.rb
sitepress-cli-4.0.4 templates/default/helpers/page_helper.rb
sitepress-cli-4.0.3 templates/default/helpers/page_helper.rb
sitepress-cli-4.0.2 templates/default/helpers/page_helper.rb
sitepress-cli-4.0.1 templates/default/helpers/page_helper.rb
sitepress-cli-4.0.0 templates/default/helpers/page_helper.rb
sitepress-cli-4.0.0.beta1 templates/default/helpers/page_helper.rb
sitepress-cli-3.2.2 templates/default/helpers/page_helper.rb
sitepress-cli-3.2.1 templates/default/helpers/page_helper.rb
sitepress-cli-3.2.0 templates/default/helpers/page_helper.rb
sitepress-cli-3.1.4 templates/default/helpers/page_helper.rb
sitepress-cli-3.1.3 templates/default/helpers/page_helper.rb
sitepress-cli-3.1.2 templates/default/helpers/page_helper.rb
sitepress-cli-3.1.1 templates/default/helpers/page_helper.rb
sitepress-cli-3.0.1 templates/default/helpers/page_helper.rb
sitepress-cli-2.0.0 templates/default/helpers/page_helper.rb
sitepress-cli-2.0.0.beta11 templates/default/helpers/page_helper.rb