mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-23 18:10:52 +02:00
feat: add support for serif font
This commit is contained in:
parent
4a22c57dc3
commit
2261d9b5f8
2 changed files with 10 additions and 2 deletions
BIN
modules/blox-tailwind/assets/dist/font/RobotoSlab-VariableFont_wght.ttf
vendored
Normal file
BIN
modules/blox-tailwind/assets/dist/font/RobotoSlab-VariableFont_wght.ttf
vendored
Normal file
Binary file not shown.
|
@ -216,7 +216,15 @@
|
||||||
|
|
||||||
{{/* Load font theme */}}
|
{{/* Load font theme */}}
|
||||||
{{ $font_family := "Inter var" }}
|
{{ $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) }}
|
{{ $font := resources.Get (printf "dist/font/%s" $font_file) }}
|
||||||
<style>
|
<style>
|
||||||
@font-face {
|
@font-face {
|
||||||
|
@ -224,7 +232,7 @@
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 100 900;
|
font-weight: 100 900;
|
||||||
font-display: swap;
|
font-display: swap;
|
||||||
src: url({{ $font.RelPermalink }}) format("woff2");
|
src: url({{ $font.RelPermalink }}) format({{$font_type}});
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue