Scratch variable set in Shortcode not available from the template of a Parent Page

I have made a small test repo to keep it simple GitHub - Oliver-Fish/hugo-scratchpad: small test case for issue with hugo scratchpad

Steps to re-produce

Launch Hugo with

hugo server -D

See that the HTML output is

<!DOCTYPE html>
<html lang="en">

<head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>some question</h1>
    <h1 id="page-title">Page Title</h1>
<ul>
<li>Some answer here</li>
</ul>

</body>

</html>

Make a change to layouts/test/single.html forcing the live reload to fire, HTML output is


<!DOCTYPE html>
<html lang="en">

<head><script src="/livereload.js?mindelay=10&amp;v=2&amp;port=1313&amp;path=livereload" data-no-instant defer></script>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1></h1>
    <h1 id="page-title">Page Title</h1>
<ul>
<li>Some answer here</li>
</ul>

</body>

</html>

alternatively you can re-produce without the live-reload by running with the command

hugo server -D --disableFastRender

With this flag set the scratchpad will always yield an empty output.