Add oEmbed discovery tags to asciicast page

This commit is contained in:
Marcin Kulik 2015-03-29 18:43:32 +00:00
parent 0930e5fa23
commit 86559fad20
3 changed files with 8 additions and 0 deletions

View File

@ -107,6 +107,10 @@ class AsciicastPagePresenter
author.asciicasts_excluding(asciicast, 3).decorate
end
def asciicast_oembed_url(routes, format)
routes.oembed_url(url: routes.asciicast_url(asciicast), format: format)
end
private
def author

View File

@ -1,4 +1,7 @@
- content_for(:title, page.title)
- content_for(:head) do
link rel="alternate" type="application/json+oembed" href="#{page.asciicast_oembed_url(self, :json)}"
link rel="alternate" type="text/xml+oembed" href="#{page.asciicast_oembed_url(self, :xml)}"
.asciicast-page
section.cinema

View File

@ -11,6 +11,7 @@ html[lang="en"]
= javascript_include_tag "player"
= favicon_link_tag 'favicon.png'
= render 'layouts/ga' if Rails.env.production?
= content_for(:head)
body
= render 'layouts/header'
= render 'shared/flash'