Skip to content

Commit

Permalink
feat: add support for serif font
Browse files Browse the repository at this point in the history
  • Loading branch information
gcushen committed May 6, 2024
1 parent 4a22c57 commit 2261d9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Binary file not shown.
12 changes: 10 additions & 2 deletions modules/blox-tailwind/layouts/partials/site_head.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,15 +216,23 @@

{{/* Load font theme */}}
{{ $font_family := "Inter var" }}
{{ $font_file := "Inter.var.woff2" }}
{{ $font_file := "" }}
{{ $font_type := "" }}
{{ if eq site.Params.appearance.font "serif" }}
{{ $font_file = "RobotoSlab-VariableFont_wght.ttf" }}
{{ $font_type = "truetype" }}
{{else}}
{{ $font_file = "Inter.var.woff2" }}
{{ $font_type = "woff2" }}
{{end}}
{{ $font := resources.Get (printf "dist/font/%s" $font_file) }}
<style>
@font-face {
font-family: '{{$font_family}}';
font-style: normal;
font-weight: 100 900;
font-display: swap;
src: url({{ $font.RelPermalink }}) format("woff2");
src: url({{ $font.RelPermalink }}) format({{$font_type}});
}
</style>

Expand Down

0 comments on commit 2261d9b

Please sign in to comment.