Skip to content

Commit

Permalink
Add description meta tag for prose files
Browse files Browse the repository at this point in the history
This adds a `<meta name="description">` tag for the main page and for
other prose files such as README files.  The tags are generated in the
same way as for code files.
  • Loading branch information
jonathanhefner committed Sep 14, 2023
1 parent 12ee375 commit d339e4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/rdoc/generator/template/rails/_head.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
<% end %>
<meta property="og:type" content="article">
<meta property="article:modified_time" content="<%= og_modified_time %>">
<% if description = page_description(context.description) %>
<meta name="description" property="og:description" content="<%= description %>">
<% end %>
3 changes: 0 additions & 3 deletions lib/rdoc/generator/template/rails/class.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
<%= include_template '_head.rhtml', {:context => klass, :tree_keys => klass.full_name.split('::') } %>

<meta property="og:title" value="<%= og_title klass.full_name %>">
<% if description = page_description(klass.description) %>
<meta name="description" property="og:description" content="<%= description %>">
<% end %>
</head>

<body>
Expand Down

0 comments on commit d339e4d

Please sign in to comment.