Skip to content

Commit

Permalink
feat: Template.HTML.Default.Layout - Adding -Separator ( Fixes #1065 )
Browse files Browse the repository at this point in the history
Also making -Content a PSObject
  • Loading branch information
James Brundage committed Mar 29, 2024
1 parent 54ada23 commit cfdcc5a
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions Languages/HTML/Templates/Layout/HTML-Default-Layout.ps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ Template function HTML.Default.Layout {
[string]
$Name,

# The content of the page. This is the main content of the page.
# The content of the page. This is the body of the page.
[vbn(Position=1)]
[Alias('PageContent','Body')]
[string]
$Content,
[psobject]
$Content,

# The separator. This will be placed between multiple content items, if `-Content` is an array.
# By default, this is a line break.
[vbn()]
[psobject]
$Separator = "<br />",

# The name of the site. If set, it will include the og:site_name meta tag.
[vbn()]
Expand Down Expand Up @@ -283,7 +289,15 @@ Template function HTML.Default.Layout {
$headerTags
</head>
<body$(if ($Class) { " class='$($class -join ' ')'"})>
$content
$(
if ($content) {
if ($content -is [Collections.IList]) {
$content -join $Separator
} else {
$content
}
}
)
</body>
</html>
"@
Expand Down

0 comments on commit cfdcc5a

Please sign in to comment.