Skip to content

Commit

Permalink
Merge pull request #4884 from Yashs911/structured-data
Browse files Browse the repository at this point in the history
Improve structured data for book name
  • Loading branch information
hornc committed Mar 26, 2021
2 parents bbb1231 + e7aab2f commit fd9693a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions openlibrary/macros/SearchResultsWork.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@

<div class="details">
<div class="resultTitle">
<h3 class="booktitle">
<a itemprop="name" href="$(book_url)?edition=$(ocaid)"
<h3 itemprop="name" class="booktitle">
<a itemprop="url" href="$(book_url)?edition=$(ocaid)"
class="results">$doc.title$(': ' + doc.subtitle if doc.get('subtitle', None) else '')</a>
$if doc.get('publish_date'):
($(doc['publish_date']))
</h3>
</div>
<span class="bookauthor">$_('by')
<span itemprop="author" itemscope itemtype="https://schema.org/Organization" class="bookauthor">$_('by')
$if not doc.authors:
<em>$_('Unknown author')</em>
$else:
$for a in doc.authors:
$if not (hasattr(a, 'name') and a.name) and not (hasattr(a, 'author') and hasattr(a.author, 'name') and a.author.name):
<em>$_('Unknown author')</em>$(',' if not loop.last else '')
$continue
<a itemprop="author" href="$(a.get('url') or a.get('key') or a.author.get('url') or a.author.key)" class="results">$(a.name or a.author.name)</a>$(',' if not loop.last else '')
<a itemprop="url" href="$(a.get('url') or a.get('key') or a.author.get('url') or a.author.key)" class="results">$(a.name or a.author.name)</a>$(',' if not loop.last else '')
</span>
<span class="resultPublisher">
$if doc.get('first_publish_year'):
Expand Down

0 comments on commit fd9693a

Please sign in to comment.