Module: Pageflow::FeedsHelper

Defined in:
app/helpers/pageflow/feeds_helper.rb

Overview

Helpers to render alternate links to atom feeds.

Since:

  • 16.1

Defined Under Namespace

Classes: FeedContent

Instance Method Summary collapse

Instance Method Details

#feed_entry_content(entry) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 16.1



28
29
30
# File 'app/helpers/pageflow/feeds_helper.rb', line 28

def feed_entry_content(entry)
  FeedContent.new(self, entry).build
end

#feed_link_tags_for_entry(entry) ⇒ Object

Render alternate links to atom feed of entries in the same site using the same locale.

Since:

  • 16.1



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'app/helpers/pageflow/feeds_helper.rb', line 8

def feed_link_tags_for_entry(entry)
  return '' unless entry.site.feeds_enabled?

  href =
    entry.site.custom_feed_url.presence&.gsub(':locale', entry.locale) ||
    pageflow.feed_url(
      {
        locale: entry.locale,
        format: 'atom'
      }.merge(Pageflow.config.site_url_options(entry.site) || {})
    )

  tag(:link,
      rel: 'alternate',
      type: 'application/atom+xml',
      title: 'Feed',
      href: href)
end