diff --git a/README.md b/README.md index 70fcd739..1e35729b 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,9 @@ googleAnalytics = "" # DEPRECATED! Use .Services.googleAnalytics.ID mathjax = true # Enable MathJax mathjaxPath = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.6/MathJax.js" # Specify MathJax path mathjaxConfig = "TeX-AMS-MML_HTMLorMML" # Specify MathJax config - googleFontsLink = "https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700" # Load Google Fonts + googleFontsLinks = [ + "https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700" # Load Google Fonts + ] customCSS = ["css/custom.css"] # Include custom CSS files customJS = ["js/custom.js"] # Include custom JS files diff --git a/exampleSite/content/docs/customization.md b/exampleSite/content/docs/customization.md index 754b6229..fae2429c 100644 --- a/exampleSite/content/docs/customization.md +++ b/exampleSite/content/docs/customization.md @@ -367,11 +367,11 @@ Our href font link: https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400&display=swap ``` -1. Set `googleFontsLink` site's config param value to your href font link. For example: +1. Set `googleFontsLinks` site's config param value to your href font links. For example: ```toml [Params] - googleFontsLink = "https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400&display=swap" + googleFontsLinks = ["https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,400;0,700;1,400&display=swap"] ``` 1. Override default font-family set(s): diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index e31fe1b3..267d1dc4 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -16,12 +16,16 @@ {{ template "_internal/twitter_cards.html" . }} {{- end }} - {{- $googleFontsLink := .Site.Params.googleFontsLink | default "https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700" }} - {{- if hasPrefix $googleFontsLink "https://fonts.googleapis.com/" }} + {{- $googleFontsLinks := .Site.Params.googleFontsLinks | default (slice "https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700") }} + {{- if $googleFontsLinks }} - + {{- range $googleFontsLinks }} + {{- if hasPrefix . "https://fonts.googleapis.com/" }} + + {{- end }} + {{- end }} {{- end }} {{ $style := resources.Get "css/style.css" | resources.ExecuteAsTemplate "css/style.css" . -}} @@ -68,4 +72,4 @@ {{- end }} {{- partial "mathjax.html" . -}} - \ No newline at end of file +