Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcrypster committed Mar 16, 2022
1 parent 0e55e86 commit aa849c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion build/phpy.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,19 @@ public static function transform_layout($data) {
$styles[] = [ 'link' => ['attrs' => ['rel' => 'stylesheet', 'href' => $url]] ];
}

if ( $data['head'] ) {
$add_head = $data['head'] ?: [];
unset($data['head']);
}

return [
'html' => [
'head' => [
'title' => $data['title'],
'<meta name="viewport" content="width=device-width, initial-scale=1">',
$styles,
[ 'link' => ['attrs' => ['rel' => "icon", 'href' => "/img/favicon.ico"]] ],
$data['head'] ?: []
$add_head
],
'body' => ['html' => $data['html'], 'attrs' => $data['attrs']],
$scripts
Expand Down
7 changes: 6 additions & 1 deletion src/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,19 @@ public static function transform_layout($data) {
$styles[] = [ 'link' => ['attrs' => ['rel' => 'stylesheet', 'href' => $url]] ];
}

if ( $data['head'] ) {
$add_head = $data['head'] ?: [];
unset($data['head']);
}

return [
'html' => [
'head' => [
'title' => $data['title'],
'<meta name="viewport" content="width=device-width, initial-scale=1">',
$styles,
[ 'link' => ['attrs' => ['rel' => "icon", 'href' => "/img/favicon.ico"]] ],
$data['head'] ?: []
$add_head
],
'body' => ['html' => $data['html'], 'attrs' => $data['attrs']],
$scripts
Expand Down

0 comments on commit aa849c4

Please sign in to comment.