Skip to content

Commit

Permalink
feat: PSJekyll.Template.IncludeGoogleFont ( Fixes #59 )
Browse files Browse the repository at this point in the history
Returning as single string.
  • Loading branch information
StartAutomating authored and StartAutomating committed Oct 6, 2024
1 parent 5c71492 commit da5d1ef
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions PSJekyll.types.ps1xml
Original file line number Diff line number Diff line change
Expand Up @@ -1182,33 +1182,31 @@ $FontName,
[string]
$CodeFont
)
@(
if ($FontName) {
"<link href='https://fonts.googleapis.com/css?family=$fontName' rel='stylesheet'>"
} else {
@(
"{% 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
} else {
"{% 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 %}"
}

if ($CodeFont) {
"<link href='https://fonts.googleapis.com/css?family=$CodeFont' rel='stylesheet'>"
} else {
@(
} 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
}
) -join [Environment]::Newline


</Script>
Expand Down

0 comments on commit da5d1ef

Please sign in to comment.