Skip to content

Commit

Permalink
Load Prism.js only with post pages
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkudrna committed Nov 16, 2020
1 parent bcad96e commit c36daa9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
8 changes: 5 additions & 3 deletions default.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
{{/is}}
</title>

<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/themes/prism-okaidia.min.css" />
{{{block "styles"}}}

<link rel="stylesheet" type="text/css" href="{{asset "built/css/main.min.css"}}" class="js-versioned-asset" />
<link rel="stylesheet" type="text/css" href="https://use.typekit.net/kwm0ygm.css" />

Expand Down Expand Up @@ -57,11 +58,12 @@
<script src="{{asset "js/main.js"}}"></script>
<script src="{{asset "js/register-sw.js"}}"></script>
<script src="{{asset "js/cache-page-assets.js"}}"></script>

{{#if @labs.members}}
<script src="{{asset "js/members.js"}}"></script>
{{/if}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/plugins/autoloader/prism-autoloader.min.js"></script>

{{{block "scripts"}}}

{{ghost_foot}}

Expand Down
22 changes: 18 additions & 4 deletions post.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,12 @@
</span>
</h2>
<div class="comments">
<div class="fb-comments" data-href="{{url absolute="true"}}" data-numposts="5"></div>
<div
class="fb-comments"
data-href="{{url absolute="true"}}"
data-numposts="5"
data-lazy="true"
></div>
</div>

</div>
Expand All @@ -146,6 +151,15 @@

{{> "footer"}}

{{!-- Facebook SDK for comments --}}
<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/cs_CZ/sdk.js#xfbml=1&version=v3.3"></script>
{{#contentFor "styles"}}
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.22.0/themes/prism-okaidia.min.css" />
{{/contentFor}}

{{#contentFor "scripts"}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.22.0/prism.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.22.0/plugins/autoloader/prism-autoloader.min.js"></script>

{{!-- Facebook SDK for comments --}}
<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/cs_CZ/sdk.js#xfbml=1&version=v9.0" nonce="tE8SW7Mk"></script>
{{/contentFor}}

0 comments on commit c36daa9

Please sign in to comment.