site

personal website, served at mordaunt.dev/site
Log | Files | Refs

theme-styles.html (2300B)


      1 {{/*
      2   Overrides the theme's copy for two reasons.
      3 
      4   The theme preloads its fonts from /fonts/, an absolute path that is only
      5   correct when the site is served at the root. This site is served under
      6   /site/ on mordaunt.dev, so those three hints fetched the 404 page at the
      7   highest priority the browser has, and the real fonts were then discovered
      8   from the stylesheet one round trip later. relURL on a *relative* path is
      9   what follows baseURL; on a path starting with "/" it is a no-op.
     10 
     11   Only the two families that are actually used are preloaded. fa-regular is
     12   referenced by @font-face and by no icon on the site, so it is never
     13   fetched unless something asks for it.
     14 */}}
     15 <link rel="preload" href="{{ "fonts/fa-solid-900.woff2" | relURL }}" as="font" type="font/woff2" crossorigin>
     16 <link rel="preload" href="{{ "fonts/fa-brands-400.woff2" | relURL }}" as="font" type="font/woff2" crossorigin>
     17 
     18 {{ if hugo.IsServer }}
     19   {{ $cssOpts := (dict "targetPath" "css/coder.css" "enableSourceMap" true ) }}
     20   {{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts }}
     21   <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
     22 {{ else }}
     23   {{ $cssOpts := (dict "targetPath" "css/coder.css" ) }}
     24   {{ $styles := resources.Get "scss/coder.scss" | resources.ExecuteAsTemplate "style.coder.css" . | toCSS $cssOpts | minify | fingerprint }}
     25   <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
     26 {{ end }}
     27 
     28 {{ if .Site.Params.rtl }}
     29   {{ if hugo.IsServer }}
     30     {{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" "enableSourceMap" true ) }}
     31     {{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts }}
     32     <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen">
     33   {{ else }}
     34     {{ $cssOpts := (dict "targetPath" "css/coder-rtl.css" ) }}
     35     {{ $styles := resources.Get "scss/coder-rtl.scss" | resources.ExecuteAsTemplate "style.coder-rtl.css" . | toCSS $cssOpts | minify | fingerprint }}
     36     <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}" crossorigin="anonymous" media="screen" />
     37   {{ end }}
     38 {{ end }}