Skip to content

Commit

Permalink
docs: PSJekyll.Template.IncludeMarginFont ( Fixes #69 )
Browse files Browse the repository at this point in the history
Renaming, allowing page margins, adding docs
  • Loading branch information
StartAutomating authored and StartAutomating committed Oct 9, 2024
1 parent 75d0ad6 commit 2795eac
Showing 1 changed file with 47 additions and 40 deletions.
87 changes: 47 additions & 40 deletions PSJekyll.types.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,53 @@ if ($CodeFont) {
) -join [Environment]::Newline


</Script>
</ScriptMethod>
<ScriptMethod>
<Name>Include.Margin.html</Name>
<Script>
&lt;#
.SYNOPSIS
Includes site margins
.DESCRIPTION
Includes site margins in the site.

This will add a style tag with the margin. It should be located in the head of the site.

If the margin parameter is provided, it will be used.

Otherwise, the `page.margin` or `site.margin` will be used.

If neither margin exists, it will default to a margin of `1em` for all elements,
and `0.5em` for all elements when the screen is less than `960px`.
#&gt;
param(
# The margin to include.
[string]
$Margin
)

if ($margin) {
"&lt;style type='text/css' id='globalMargin'&gt;$margin&lt;/style&gt;"
} else {
@(
"{% if page.margin %}"
"&lt;style id='globalMargin' type='text/css'&gt;{{page.margin}}&lt;/style&gt;"
"{% if site.margin %}"
"&lt;style id='globalMargin' type='text/css'&gt;{{site.margin}}&lt;/style&gt;"
"{% else %}"
@"
&lt;style type='text/css' id='globalMargin'&gt;
body &gt; * { margin: 1em; }
@media (max-width: 960px) {
body &gt; * { margin: .5em; }
}
&lt;/style&gt;
"@
"{% endif %}"
) -join [Environment]::Newline
}

</Script>
</ScriptMethod>
<ScriptMethod>
Expand Down Expand Up @@ -1555,46 +1602,6 @@ if ($ImportMap) {
}
</Script>
</ScriptMethod>
<ScriptMethod>
<Name>IncludeMargin</Name>
<Script>
&lt;#
.SYNOPSIS
Includes site margins
.DESCRIPTION
Includes site margins in the site.

This will add a style tag with the margin. It should be located in the head of the site.

If the margin parameter is provided, it will be used. Otherwise, the site.margin will be used.
#&gt;
param(
# The margin to include.
[string]
$Margin
)

if ($margin) {
"&lt;style type='text/css' id='globalMargin'&gt;$margin&lt;/style&gt;"
} else {
@(
"{% if site.margin %}"
"&lt;style id='globalMargin' type='text/css'&gt;{{site.margin}}&lt;/style&gt;"
"{% else %}"
@"
&lt;style type='text/css' id='globalMargin'&gt;
body &gt; * { margin: 1em; }
@media (max-width: 960px) {
body &gt; * { margin: .5em; }
}
&lt;/style&gt;
"@
"{% endif %}"
) -join [Environment]::Newline
}

</Script>
</ScriptMethod>
<ScriptMethod>
<Name>IncludeMyRepos</Name>
<Script>
Expand Down

0 comments on commit 2795eac

Please sign in to comment.