small optimizations to satisfy Google Lighthouse a bit more
| | |
| | | if(links) { |
| | | Array.from(links).forEach(function(link, index){ |
| | | let target, rel, blank, noopener, attr1, attr2, url, isExternal; |
| | | url = elemAttribute(link, 'href'); |
| | | isExternal = (url && typeof url == 'string' && url.startsWith('http')) && !url.startsWith(rootURL) && link.closest(contentWrapperClass); |
| | | url = new URL(elemAttribute(link, 'href')); |
| | | // definition of same origin: RFC 6454, section 4 (https://tools.ietf.org/html/rfc6454#section-4) |
| | | isExternal = url.host !== location.host || url.protocol !== location.protocol || url.port !== location.port; |
| | | if(isExternal) { |
| | | target = 'target'; |
| | | rel = 'rel'; |
| | |
| | | font-style: normal |
| | | font-weight: 400 |
| | | src: local('Metropolis Regular'), local('Metropolis-Regular'), url('#{$font-path}/Metropolis-Regular.woff2') format('woff2'), url('#{$font-path}/Metropolis-Regular.woff') format('woff') |
| | | font-display: swap |
| | | |
| | | @font-face |
| | | font-family: 'Metropolis' |
| | | font-style: normal |
| | | font-weight: 300 |
| | | src: local('Metropolis Light'), local('Metropolis-Light'), url('#{$font-path}/Metropolis-Light.woff2') format('woff2'), url('#{$font-path}/Metropolis-Light.woff') format('woff') |
| | | font-display: swap |
| | | |
| | | @font-face |
| | | font-family: 'Metropolis' |
| | | font-style: italic |
| | | font-weight: 300 |
| | | src: local('Metropolis Light Italic'), local('Metropolis-LightItalic'), url('#{$font-path}/Metropolis-LightItalic.woff2') format('woff2'), url('#{$font-path}/Metropolis-LightItalic.woff') format('woff') |
| | | font-display: swap |
| | | |
| | | @font-face |
| | | font-family: 'Metropolis' |
| | | font-style: normal |
| | | font-weight: 500 |
| | | src: local('Metropolis Medium'), local('Metropolis-Medium'), url('#{$font-path}/Metropolis-Medium.woff2') format('woff2'), url('#{$font-path}/Metropolis-Medium.woff') format('woff') |
| | | font-display: swap |
| | | |
| | | @font-face |
| | | font-family: 'Metropolis' |
| | | font-style: italic |
| | | font-weight: 500 |
| | | src: local('Metropolis Medium Italic'), local('Metropolis-MediumItalic'), url('#{$font-path}/Metropolis-MediumItalic.woff2') format('woff2'), url('#{$font-path}/Metropolis-MediumItalic.woff') format('woff') |
| | | font-display: swap |
| | | |
| | | @font-face |
| | | font-family: 'Cookie' |
| | | font-style: normal |
| | | font-weight: 400 |
| | | src: local('Cookie-Regular'), url('#{$font-path}/cookie-v10-latin-regular.woff2') format('woff2'), url('#{$font-path}/cookie-v10-latin-regular.woff') format('woff') |
| | | font-display: swap |
| | |
| | | {{- $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") -}} |
| | | {{- $styles := resources.Get "sass/main.sass" | resources.ExecuteAsTemplate "main.sass" . | resources.ToCSS $options | resources.Fingerprint "sha512" }} |
| | | <link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}"> |
| | | |
| | | {{- $sp := .Site.Params }} |
| | | {{ with $sp.metaThemeColor }} |
| | | <meta name="theme-color" content="{{.}}"> |
| | | {{ end }} |
| | | |
| | | {{ if .Description }} |
| | | <meta name="description" content="{{ .Description }}"> |
| | | {{ else if .IsPage }} |
| | | <meta name="description" content="{{ .Summary | plainify }}"> |
| | | {{ else if .Site.Params.Description }} |
| | | <meta name="descripion" content="{{.}}"> |
| | | {{ end }} |