$def with (items, key, total_items, owners_page, current_page, sort_order='desc', user=None, include_ratings=False) $ username = user.key.split('/')[-1] $ meta_photo_url = "https://archive.org/services/img/%s" % get_internet_archive_id(user.key) $ userDisplayName = user.displayname or ctx.user.displayname $if key == 'currently-reading': $ og_title = _("Books %(username)s is reading", username=userDisplayName) $ og_description = _("%(username)s is reading %(total)d books. Join %(username)s on OpenLibrary.org and tell the world what you're reading.", username=userDisplayName, total=total_items) $elif key == 'want-to-read': $ og_title = _("Books %(username)s wants to read", username=userDisplayName) $ og_description = _("%(username)s wants to read %(total)d books. Join %(username)s on OpenLibrary.org and share the books that you'll soon be reading!", username=userDisplayName, total=total_items) $elif key == 'already-read': $ og_title = _("Books %(username)s has read", username=userDisplayName) $ og_description = _("%(username)s has read %(total)d books. Join %(username)s on OpenLibrary.org and tell the world about the books that you care about.", username=userDisplayName, total=total_items) $elif key == 'sponsorships': $ og_title = _("Books %(userdisplayname)s is sponsoring", userdisplayname=userDisplayName) $ og_description = "{username} is sponsoring {total} books. Join {username} on OpenLibrary.org and share the books that you'll soon be reading!".format(username=userDisplayName, total=total_items) $putctx("description", og_description) $add_metatag(property="og:title", content=og_title) $add_metatag(property="og:url", content=request.canonical_url) $add_metatag(property="og:site_name", content="Open Library") $add_metatag(property="og:description", content=og_description) $add_metatag(property="og:image", content=meta_photo_url)