Skip to content

Commit a3744be

Browse files
committed
Fix last error by changing the field name "head" to "meta"
Not entirely sure how this would matter, but it appears to be related to this change in Template::Mustache: raku-community-modules/Template-Mustache@92c8af3 The behaviour observed was that it was doing %args.head instead of %args<head>. Still not 100% sure this isn't really a bug in the latest version of Template::Mustache (1.2.4)
1 parent 2be0430 commit a3744be

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

resources/examples/with-partials/main.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="{{lang}}">
33

44
<head>
5-
{{> meta }}
5+
{{> head }}
66
</head>
77

88
<body class="pod">

t/011-external.rakutest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ sub test-files( $possible-file-path ) {
1919
my $r = node2html $pod;
2020
ok( $r, "Converting external" );
2121
unlike( $r, /Pod\:\:To/, "Is not prepending class name" );
22-
$r = pod2html($pod, :header(''), :footer(''), :head(''), :default-title(''), :lang('en'));
22+
$r = pod2html($pod, :header(''), :footer(''), :meta(''), :default-title(''), :lang('en'));
2323
unlike( $r, /Pod\:\:To/, "Is not prepending class name" );
2424
}
2525

t/120-templates.rakutest

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,9 @@ $r = pod2html $=pod[0], :templates("t/templates");
4141
ok $r ~~ ms[[ '<meta description="This is a new template"/>' ]], 'Gets text from new template';
4242
ok $r ~~ ms[[ "<h1 class='title'>The usual suspects</h1>" ]], 'Fills template correctly';
4343

44-
my $head='<meta name=viewport content="width=device-width, initial-scale=1">';
45-
$r = pod2html $=pod[0], :templates("t/templates"), :$head ;
46-
#say $head;
47-
#say "===================================================";
48-
#say $r;
49-
todo("This only succeeds roughly 1 in 10 times");
50-
ok $r ~~ ms[[ $head ]], 'headers are rendered as is';
44+
my $meta='<meta name=viewport content="width=device-width, initial-scale=1">';
45+
$r = pod2html $=pod[0], :templates($*PROGRAM.sibling("templates")), :$meta;
46+
ok $r ~~ ms[[ $meta ]], 'headers are rendered as is';
5147

5248
class Pod::To::HTML::Dummy does Pod::To::HTML::Renderer {
5349
method render(%context) {

t/templates/main.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</style>
1717
{{# css }}<link rel="stylesheet" href="{{ css }}">{{/ css }}
1818
{{# metadata }}{{{ metadata }}}{{/ metadata }}
19-
{{{ head }}}
19+
{{{ meta }}}
2020
</head>
2121
<body class="pod">
2222
<div id="___top"></div>

0 commit comments

Comments
 (0)