feed.atom.builder 883 B

12345678910111213141516171819202122232425262728
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. atom_feed(root_url: @root_url) do |feed|
  3. author_name = @knowledge_base.translations.first.title
  4. feed.title kb_public_page_title(@knowledge_base, @category, nil)
  5. feed.updated updating_date(@answers.first) if @answers.any?
  6. @answers.each do |answer|
  7. translation = answer.translations.first
  8. body = simplify_rich_text(translation.content.body)
  9. hash = {
  10. url: build_original_url(answer),
  11. id: "kb-answer-#{translation.id}-#{translation.updated_at.to_i}",
  12. published: publishing_date(answer),
  13. updated: updating_date(answer)
  14. }
  15. feed.entry(translation, hash) do |entry|
  16. entry.title translation.title
  17. entry.author do |author|
  18. author.name author_name
  19. end
  20. entry.content body, type: 'html'
  21. end
  22. end
  23. end