$def with(book, size="M") $ title = book.title $ author_names = None $if any(book.get_authors()): $ author_names = ", ".join(a.get("name", "Name missing") for a in book.get_authors()) $if not author_names: $ author_names = book.get('by_statement','') $ cover_url = book.get_cover_url(size) $ cover_lg = book.get_cover_url("L") $if size == "M":
Cover of: $title | $author_names
$:macros.TruncateString(title, 70)
$:macros.TruncateString(author_names, 30)
$else: We need a book cover for: $title