Skip to content

Commit

Permalink
modified header and footer for css plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
somrat committed Oct 22, 2019
1 parent aef7eda commit 81b0a79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 22 deletions.
17 changes: 0 additions & 17 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,6 @@ <h6>Follow</h6>
</div>
</footer>

{{ $script:= "script" }}
{{ $scriptTag:= "<" }}
{{$scriptTag | safeHTML }}{{$script}} type="text/javascript">

{{ $.Scratch.Set "counter" 0 }}
{{ range .Site.Params.plugins.css }}
{{ $.Scratch.Set "counter" (add ($.Scratch.Get "counter") 1) }}
var css{{$.Scratch.Get `counter`}} = document.createElement('link');
css{{$.Scratch.Get `counter`}}.rel = 'stylesheet';
css{{$.Scratch.Get `counter`}}.href = '{{ .URL | absURL }}';
css{{$.Scratch.Get `counter`}}.type = 'text/css';
var fastCSS{{$.Scratch.Get `counter`}} = document.getElementsByTagName('link')[0];
fastCSS{{$.Scratch.Get `counter`}}.parentNode.insertBefore(css{{$.Scratch.Get `counter`}}, fastCSS{{$.Scratch.Get `counter`}});
{{ end }}

</script>

<script>
var indexURL = {{ "index.json" | absURL }}
</script>
Expand Down
8 changes: 3 additions & 5 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
{{ hugo.Generator }}

{{ "<!-- plugins -->" | safeHTML }}
<noscript>
{{ range .Site.Params.plugins.css }}
<link rel="stylesheet" href="{{ .URL | absURL }} ">
{{ end }}
</noscript>
{{ range .Site.Params.plugins.css }}
<link rel="stylesheet" href="{{ .URL | absURL }} ">
{{ end }}

{{ "<!-- Main Stylesheet -->" | safeHTML }}
{{ $styles := resources.Get "css/style.css" | minify }}
Expand Down

0 comments on commit 81b0a79

Please sign in to comment.