Skip to content

Commit

Permalink
feat: PSJekyll.Template.IncludeGoogleFont ( Fixes #59 )
Browse files Browse the repository at this point in the history
Adding codefont, defaulting to Roboto
  • Loading branch information
StartAutomating authored and StartAutomating committed Oct 6, 2024
1 parent b926e42 commit 7e51d73
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion PSJekyll.types.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,10 @@ if ($PaletteName) {
param(
# The name of the font to include.
[string]
$FontName
$FontName,

[string]
$CodeFont
)
if ($FontName) {
"<link href='https://fonts.googleapis.com/css?family=$fontName' rel='stylesheet'>"
Expand All @@ -1186,6 +1189,23 @@ if ($FontName) {
"{% if site.googleFont %}"
"<link href='https://fonts.googleapis.com/css?family={{site.googleFont}}' rel='stylesheet'>"
"<style type='text/css'>body { font-family: '{{site.googleFont}}',sans-serif } </style>"
"{% else %}"
"<link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet'>"
"<style type='text/css'>body { font-family: 'Roboto',sans-serif } </style>"
"{% endif %}"
) -join [Environment]::Newline
}

if ($CodeFont) {
"<link href='https://fonts.googleapis.com/css?family=$CodeFont' rel='stylesheet'>"
} else {
@(
"{% if site.codeFont %}"
"<link href='https://fonts.googleapis.com/css?family={{site.codeFont}}' rel='stylesheet'>"
"<style type='text/css'>code, pre { font-family: '{{site.codeFont}}',monospace } </style>"
"{% else %}"
"<link href='https://fonts.googleapis.com/css?family=Roboto+Mono' rel='stylesheet'>"
"<style type='text/css'>code, pre { font-family: 'Roboto Mono',monospace } </style>"
"{% endif %}"
) -join [Environment]::Newline
}
Expand Down

0 comments on commit 7e51d73

Please sign in to comment.