The Open Graph image property requires the full absolute URL rather than the
relative URL that was previously used on the record summary page.
Test Plan:
Pre-patch - Visit a record summary page in the catalog. View the source of the
page. In the head section, find the og:image meta property. The content will
display a relative URL to the record's book jacket cover image.
Post-patch - When viewing the source of the page, og:image will display the
full URL.
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
-[% PROCESS "opac/parts/misc_util.tt2";
+[%- PROCESS "opac/parts/misc_util.tt2";
USE ResolverResolver;
- ctx.page_title = attrs.title | html
- ctx.metalinks.push('<meta property="og:image" content="' _ ctx.media_prefix _ '/opac/extras/ac/jacket/large/r/' _ ctx.bre_id _ '" />');
-%]
+ ctx.page_title = attrs.title | html;
+ full_image_path = ctx.proto _ '://' _ ctx.hostname _ '/opac/extras/ac/jacket/' _ record.summary.jacket_size _ '/r/' _ ctx.bre_id;
+ ctx.metalinks.push('<meta property="og:image" content="' _ full_image_path _ '" />');
+-%]
<!-- ****************** rdetail_summary.xml ***************************** -->
<abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% ctx.bre_id %]'></abbr>