|
30 | 30 | <link rel="canonical" href="<%= canonical_url %>"> |
31 | 31 | <%- end -%> |
32 | 32 |
|
| 33 | +<!-- Open Graph / Facebook --> |
| 34 | +<meta property="og:type" content="website"> |
| 35 | +<meta property="og:title" content="<%= h @title %>"> |
| 36 | +<%- if defined?(klass) -%> |
| 37 | + <%- if klass.comment.empty? -%> |
| 38 | + <meta property="og:description" content="Documentation for <%= h klass.full_name %> <%= h klass.type %> - API reference and code examples"> |
| 39 | + <%- else -%> |
| 40 | + <meta property="og:description" content="<%= h excerpt(klass.comment) %>"> |
| 41 | + <%- end -%> |
| 42 | +<%- elsif defined?(file) -%> |
| 43 | + <%- if file.comment.empty? -%> |
| 44 | + <meta property="og:description" content="<%= h file.page_name %> - <%= h @title %> documentation"> |
| 45 | + <%- else -%> |
| 46 | + <meta property="og:description" content="<%= h excerpt(file.comment) %>"> |
| 47 | + <%- end -%> |
| 48 | +<%- else -%> |
| 49 | + <meta property="og:description" content="API documentation for <%= h @title %> - Browse classes, modules, and methods"> |
| 50 | +<%- end -%> |
| 51 | +<%- if canonical_url = @options.canonical_root -%> |
| 52 | +<% canonical_url = current.canonical_url if defined?(current) %> |
| 53 | +<meta property="og:url" content="<%= canonical_url %>"> |
| 54 | +<%- end -%> |
| 55 | + |
| 56 | +<!-- Twitter --> |
| 57 | +<meta name="twitter:card" content="summary"> |
| 58 | +<meta name="twitter:title" content="<%= h @title %>"> |
| 59 | +<%- if defined?(klass) -%> |
| 60 | + <%- if klass.comment.empty? -%> |
| 61 | + <meta name="twitter:description" content="Documentation for <%= h klass.full_name %> <%= h klass.type %> - API reference and code examples"> |
| 62 | + <%- else -%> |
| 63 | + <meta name="twitter:description" content="<%= h excerpt(klass.comment) %>"> |
| 64 | + <%- end -%> |
| 65 | +<%- elsif defined?(file) -%> |
| 66 | + <%- if file.comment.empty? -%> |
| 67 | + <meta name="twitter:description" content="<%= h file.page_name %> - <%= h @title %> documentation"> |
| 68 | + <%- else -%> |
| 69 | + <meta name="twitter:description" content="<%= h excerpt(file.comment) %>"> |
| 70 | + <%- end -%> |
| 71 | +<%- else -%> |
| 72 | + <meta name="twitter:description" content="API documentation for <%= h @title %> - Browse classes, modules, and methods"> |
| 73 | +<%- end -%> |
| 74 | + |
33 | 75 | <script type="text/javascript"> |
34 | 76 | var rdoc_rel_prefix = "<%= h asset_rel_prefix %>/"; |
35 | 77 | var index_rel_prefix = "<%= h rel_prefix %>/"; |
|
0 commit comments