Checkpoint main.css and add it to the <head>; add links for page resource CSS if they exist

This commit is contained in:
Eryn Wells 2021-12-26 12:39:49 -07:00
parent 8a6ec79adf
commit af7252aa6e
2 changed files with 332 additions and 19 deletions

View file

@ -15,10 +15,9 @@
<meta name="author" content="{{ site.Author.name }}" />
{{ end }}
<link rel="preload stylesheet" as="style" href="/styles/reset.css" />
<link rel="preload stylesheet" as="style" href="/styles/app.css" />
{{ if .IsHome }}
<link rel="preload stylesheet" as="style" href="/styles/home.css" />
<link rel="preload stylesheet" as="style" href="/styles/main.css">
{{ range $stylesheet := .Resources.Match "*.css" }}
<link rel="preload stylesheet" as="style" href="{{ $stylesheet.Permalink }}">
{{ end }}
{{ if and .IsPage (not site.Params.disableHLJS) }}
@ -31,35 +30,24 @@
{{ end }}
{{ range $.Scratch.Get "social-list" }}
<link rel="preload" as="image" href="{{ printf `%s.svg` . | absURL }}" />
<link rel="preload" as="image" href="{{ printf `%s.svg` . | absURL }}">
{{ end }}
<!-- Favicon -->
<link rel="icon" href="{{ `favicon.ico` | absURL }}" />
<link rel="apple-touch-icon" href="{{ `apple-touch-icon.png` | absURL }}" />
<link rel="icon" href="{{ `favicon.ico` | absURL }}">
<link rel="apple-touch-icon" href="{{ `apple-touch-icon.png` | absURL }}">
<!-- Generator -->
{{ hugo.Generator }}
<!-- RSS -->
{{ range .AlternativeOutputFormats }}
<link
rel="{{ .Rel }}"
type="{{ .MediaType.Type }}"
href="{{ .Permalink }}"
title="{{ site.Title }}"
/>
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink }}" title="{{ site.Title }}">
{{ end }}
<!-- Misc -->
{{ if or hugo.IsProduction (eq site.Params.env "production") }}
<!---->
{{ template "_internal/google_analytics_async.html" . }}
<!---->
{{ template "_internal/google_news.html" . }}
<!---->
{{ template "_internal/opengraph.html" . }}
<!---->
{{ template "_internal/schema.html" . }}
<!---->
{{ template "_internal/twitter_cards.html" . }}