Move per-page CSS to HTML head

This commit is contained in:
James 2018-07-09 21:25:52 +10:00
parent 275a34b0a2
commit f108e5d9f0
2 changed files with 8 additions and 4 deletions

View file

@ -22,7 +22,8 @@
<link href="https://fonts.googleapis.com/css?family=Ubuntu|Dosis" rel="stylesheet">
<link href="https://use.fontawesome.com/releases/v5.0.2/css/all.css" rel="stylesheet">
<link rel="stylesheet" href="{{ .Site.BaseURL }}/css/style.css" />
{{- block "css" . }}{{- end }}
{{ if eq (getenv "HUGO_ENV") "PRD" }}
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id={{ .Site.Params.GoogleAnalyticsTrackingId }}"></script>
@ -46,7 +47,7 @@
{{- end }}
{{ .Render "header" }}
{{ block "header" . }}{{ end }}
{{ $full_width := .Params.FullWidth | default false }}
@ -87,4 +88,4 @@
{{- end }}
</body>
</html>
</html>

View file

@ -28,9 +28,12 @@
</section>
{{ end }}
{{ define "css" }}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.10.0/baguetteBox.min.css" type="text/css" />
{{ end }}
{{ define "scripts" }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.10.0/baguetteBox.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.10.0/baguetteBox.min.css" type="text/css" />
<script type="text/javascript">
window.addEventListener("DOMContentLoaded", function() {