Skip to content

Commit

Permalink
Fix unintended HTML in <head>
Browse files Browse the repository at this point in the history
The load-photoswipe-theme partial was being incorrectly loaded in the <head>. Instead, we should load the CSS in the head, and the initialization HTML should go in the <body>
  • Loading branch information
Michael Romero committed Sep 18, 2018
1 parent c95cb46 commit 1a5d075
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 3 additions & 1 deletion layouts/partials/head.html
Expand Up @@ -62,7 +62,9 @@
<script src='https://www.google.com/recaptcha/api.js'></script> <script src='https://www.google.com/recaptcha/api.js'></script>
{{- end -}} {{- end -}}


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.css" integrity="sha384-h/L2W9KefUClHWaty3SLE5F/qvc4djlyR4qY3NUV5HGQBBW7stbcfff1+I/vmsHh" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/default-skin/default-skin.min.css" integrity="sha384-iD0dNku6PYSIQLyfTOpB06F2KCZJAKLOThS5HRe8b3ibhdEQ6eKsFf/EeFxdOt5R" crossorigin="anonymous">

{{- partial "head_custom.html" . }} {{- partial "head_custom.html" . }}
{{- partial "load-photoswipe-theme.html" . }}
{{ template "_internal/google_analytics_async.html" . }} {{ template "_internal/google_analytics_async.html" . }}
</head> </head>
2 changes: 2 additions & 0 deletions layouts/partials/header.html
@@ -1,3 +1,5 @@
{{- partial "load-photoswipe-theme.html" . }}

{{ if .IsHome }} {{ if .IsHome }}
{{ if .Site.Params.homeTitle }}{{ $.Scratch.Set "title" .Site.Params.homeTitle }}{{ else }}{{ $.Scratch.Set "title" .Site.Title }}{{ end }} {{ if .Site.Params.homeTitle }}{{ $.Scratch.Set "title" .Site.Params.homeTitle }}{{ else }}{{ $.Scratch.Set "title" .Site.Title }}{{ end }}
{{ if .Site.Params.subtitle }}{{ $.Scratch.Set "subtitle" .Site.Params.subtitle }}{{ end }} {{ if .Site.Params.subtitle }}{{ $.Scratch.Set "subtitle" .Site.Params.subtitle }}{{ end }}
Expand Down
8 changes: 0 additions & 8 deletions layouts/partials/load-photoswipe-theme.html
Expand Up @@ -2,14 +2,6 @@
Documentation and licence at https://github.com/liwenyip/hugo-easy-gallery/ Documentation and licence at https://github.com/liwenyip/hugo-easy-gallery/
--> -->


<!-- Photoswipe css/js libraries -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.css" integrity="sha384-h/L2W9KefUClHWaty3SLE5F/qvc4djlyR4qY3NUV5HGQBBW7stbcfff1+I/vmsHh" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/default-skin/default-skin.min.css" integrity="sha384-iD0dNku6PYSIQLyfTOpB06F2KCZJAKLOThS5HRe8b3ibhdEQ6eKsFf/EeFxdOt5R" crossorigin="anonymous">
<!-- these files are loaded in the theme footer
<script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.js" integrity="sha384-QELNnmcmU8IR9ZAykt67vGr9/rZJdHbiWi64V88fCPaOohUlHCqUD/unNN0BXSqy" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe-ui-default.min.js" integrity="sha384-m67o7SkQ1ALzKZIFh4CiTA8tmadaujiTa9Vu+nqPSwDOqHrDmxLezTdFln8077+q" crossorigin="anonymous"></script>
-->

<!-- Root element of PhotoSwipe. Must have class pswp. --> <!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true"> <div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">
<!-- Background of PhotoSwipe. <!-- Background of PhotoSwipe.
Expand Down

0 comments on commit 1a5d075

Please sign in to comment.