Last active
January 24, 2024 22:01
-
-
Save damien1/8fd26c6fc0dc864ab2058487f2702c41 to your computer and use it in GitHub Desktop.
Hugo Shortcode add Google Fonts and style to selected text. Visit my site for details https://bit.ly/31PSv6d example: {{< typography font="monoton" size="100px" style="italic" >}}You are awesome. You're even better! {{< /typography >}}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- for usage details visit https://bit.ly/31PSv6d --> | |
{{ $font := .Get "font" }} | |
{{ $size := .Get "size" }} | |
{{ $style := .Get "style" | default "normal" }} | |
{{ $weight := .Get "weight" | default "normal" }} | |
<link href="https://fonts.googleapis.com/css?family={{ $font }}" rel="stylesheet" type="text/css"> | |
<div style="font-family:'{{ $font }}'; font-size:{{ $size }}; font-style:{{ $style}}; font-weight:{{ $weight }}"> | |
{{- .Inner -}} | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you, that makes sense. I'm still very new to Hugo. Thanks again.