Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
The Old Man Posted February 7, 2022 Posted February 7, 2022 Hi IPS, Please can you fix the the Google Fonts integration as the new improved API has been out for some time now? Themes > Core > Global > Global > includeCSS template: {{if ( theme.headline_font && theme.headline_font !== 'default' ) || ( theme.body_font && theme.body_font !== 'default' ) }} {{if theme.headline_font == theme.body_font}} <link href="https://fonts.googleapis.com/css?family={expression="\IPS\Http\Url::encodeComponent( \IPS\Http\Url::COMPONENT_FRAGMENT, \IPS\Theme::i()->settings['body_font'] )"}:300,300i,400,400i,500,700,700i" rel="stylesheet" referrerpolicy="origin"> {{else}} {{if ( theme.headline_font && theme.headline_font !== 'default' )}} <link href="https://fonts.googleapis.com/css?family={expression="\IPS\Http\Url::encodeComponent( \IPS\Http\Url::COMPONENT_FRAGMENT, \IPS\Theme::i()->settings['headline_font'] )"}:300,300i,400,500,400i,700,700i" rel="stylesheet" referrerpolicy="origin"> {{endif}} {{if ( theme.body_font && theme.body_font !== 'default' )}} <link href="https://fonts.googleapis.com/css?family={expression="\IPS\Http\Url::encodeComponent( \IPS\Http\Url::COMPONENT_FRAGMENT, \IPS\Theme::i()->settings['body_font'] )"}:300,300i,400,400i,500,700,700i" rel="stylesheet" referrerpolicy="origin"> {{endif}} {{endif}} {{endif}} I know the old links are still compatible Google provid the new V2 links some time ago, they supposedly offer various improvements, new variable fonts, reduced latency, smaller code, display: swap etc. The new link are similar to: <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap" rel="stylesheet"> Or for the variable fonts versions: <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300..700&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Inter:slnt,wght@-10..0,300..700&display=swap" rel="stylesheet"> https://developers.google.com/fonts/docs/css2https://web.dev/variable-fonts/ AlexWebsites, SeNioR-, Ehren and 1 other 1 3
Ehren Posted February 8, 2022 Posted February 8, 2022 Thanks @The Old Man This has been on my radar for a while - I'll pass it onto the team to see what they think! 🙂 Marc, AlexWebsites and The Old Man 2 1
Recommended Posts