|
| 1 | +<meta charset="<%= @options.charset %>"> |
| 2 | +<meta name="viewport" content="width=device-width, initial-scale=1"> |
| 3 | + |
| 4 | +<title><%= h @title %></title> |
| 5 | + |
| 6 | +<%- if defined?(klass) %> |
| 7 | + <meta name="keywords" content="ruby,<%= h "#{klass.type},#{klass.full_name}" %>"> |
| 8 | + |
| 9 | + <%- if klass.comment.empty? %> |
| 10 | + <meta name="description" content="Documentation for the <%= h "#{klass.full_name} #{klass.type}" %>"> |
| 11 | + <%- else %> |
| 12 | + <meta name="description" content="<%= h "#{klass.type} #{klass.full_name}: #{excerpt(klass.comment)}" %>"> |
| 13 | + <%- end %> |
| 14 | +<%- elsif defined?(file) %> |
| 15 | + <meta name="keywords" content="ruby,documentation,<%= h file.page_name %>"> |
| 16 | + <meta name="description" content="<%= h "#{file.page_name}: #{excerpt(file.comment)}" %>"> |
| 17 | +<%- elsif @title %> |
| 18 | + <meta name="keywords" content="ruby,documentation,<%= h @title %>"> |
| 19 | + |
| 20 | + <%- if @options.main_page and |
| 21 | + main_page = @files.find { |f| f.full_name == @options.main_page } then %> |
| 22 | + <meta name="description" content="<%= h "#{@title}: #{excerpt(main_page.comment)}" %>"> |
| 23 | + <%- else %> |
| 24 | + <meta name="description" content="Documentation for <%= h @title %>"> |
| 25 | + <%- end %> |
| 26 | +<%- end %> |
| 27 | + |
| 28 | +<%- if canonical_url = @options.canonical_root %> |
| 29 | +<% canonical_url = current.canonical_url if defined?(current) %> |
| 30 | +<link rel="canonical" href="<%= canonical_url %>"> |
| 31 | +<%- end %> |
| 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 | + |
| 75 | +<script type="text/javascript"> |
| 76 | + var rdoc_rel_prefix = "<%= h asset_rel_prefix %>/"; |
| 77 | + var index_rel_prefix = "<%= h rel_prefix %>/"; |
| 78 | +</script> |
| 79 | + |
| 80 | +<script src="<%= h asset_rel_prefix %>/js/theme-toggle.js"></script> |
| 81 | +<script src="<%= h asset_rel_prefix %>/js/navigation.js" defer></script> |
| 82 | +<script src="<%= h asset_rel_prefix %>/js/search.js" defer></script> |
| 83 | +<script src="<%= h asset_rel_prefix %>/js/search_index.js" defer></script> |
| 84 | +<script src="<%= h asset_rel_prefix %>/js/searcher.js" defer></script> |
| 85 | +<script src="<%= h asset_rel_prefix %>/js/aliki.js" defer></script> |
| 86 | + |
| 87 | +<link href="<%= h asset_rel_prefix %>/css/rdoc.css" rel="stylesheet"> |
| 88 | +<%- @options.template_stylesheets.each do |stylesheet| %> |
| 89 | +<link href="<%= h asset_rel_prefix %>/<%= File.basename stylesheet %>" rel="stylesheet"> |
| 90 | +<%- end %> |
0 commit comments