The code for your page template cannot be inserted within an HTML widget as code – that creates an .html file within your Hype resources library. Your page template needs to be defined in your Wordpress theme. When you create a Page Template, you can select it as a ‘Template’ when composing a page within your Wordpress Post Editor.
You’ll need to create a new .php file within your Theme directory called something like page-hypeexample.php and use this code:
<?php /* Template Name: My Custom Page */ ?>
<?php get_header(); ?>
<div id="primary">
<div id="content">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>
Then, make a new page and select the custom template name defined in this file. Next, publish the page, and get the URL of that page and insert it within an HTML widget’s source URL.
This page explains how to create a Page Template: https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/#creating-a-custom-page-template-for-one-specific-page