Page MenuHomeMiraheze

Add <link/> to <head>
Closed, ResolvedPublic

Description

After a discussion on Discord, I learned that (apparently) it's possible to add <link/> tags to <head>. If possible, within the Miraheze infrastructure, I would like to add the following tags into my wiki:

<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">

It's the fonts Roboto and Montserrat with different weights, directly from Google Fonts. I believe the first tag with rel=preconnect is necessary, but I'm not sure (I never used <link> for fonts on my websites before).

R4356th mentioned a page as a reference and I think it's good to include it here as well.

Also, I know that is possible to use CSS' @import, but I want to avoid to do that because @import makes a HTTP request, and depending on the amount of things you want to use, this could heavily affect the website's performance.