function formatResponse(post, context, locals = {}) {
    // build up @page data for use in templates
    // - done here rather than `update-local-template-options` middleware because
    //   we need access to the rendered entry's data which isn't available in middleware
    const pageData = {
        show_title_and_feature_image: true // default behaviour
    };

    // grab data off of the post that will be deleted in prepareContextResource
    const showTitleAndFeatureImage = post.show_title_and_feature_image;

    prepareContextResource(post);

    let entry = {
        post: post
    };

    // NOTE: preview context is a special case where the internal preview api returns the post model's type field
    if (context?.includes('page') || (context?.includes('preview') && post.type === 'page')) {
        entry.page = post;

        // move properties from the page context object onto @page
        // - makes the value available outside of the page context
        // - data is removed from the post object in prepareContextResource so use of @page is forced
        if (showTitleAndFeatureImage !== undefined) {
            pageData.show_title_and_feature_image = showTitleAndFeatureImage;
        }
    }

    // merge @page into local template options
    const localTemplateOptions = hbs.getLocalTemplateOptions(locals);
    hbs.updateLocalTemplateOptions(locals, _.merge({}, localTemplateOptions, {
        data: {
            page: pageData
        }
    }));

    return entry;
}
@description Format a single resource for handlebars.

@TODO
In the future, we should return {page: entry} or {post:entry).
But for now, we would break the themes if we just change it.

@see https://github.com/TryGhost/Ghost/issues/10042.

@return {Object} containing page variables