Skip to content

Commit

Permalink
Put disqus script into footerScripts section. (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalstrzelecki committed May 31, 2017
1 parent 24aeca2 commit c993e77
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions resources/views/includes/disqus/disqus.blade.php
@@ -1,28 +1,30 @@
<div id="disqus_thread"></div>
@if(config('disqus.domain') && config('disqus.api_key'))
<script>
var disqus_config = function() {
this.page.url = "{{$url}}"; // page's canonical url
this.page.identifier = {{$contentId}}; // page's unique identifier
// The generated payload which authenticates users with Disqus
this.page.remote_auth_s3 = '{{$remoteAuthS3}}';
this.page.api_key = '{{config('disqus.api_key')}}';
@section('footerScripts')
@if(config('disqus.domain') && config('disqus.api_key'))
<script>
var disqus_config = function() {
this.page.url = "{{$url}}"; // page's canonical url
this.page.identifier = {{$contentId}}; // page's unique identifier
// The generated payload which authenticates users with Disqus
this.page.remote_auth_s3 = '{{$remoteAuthS3}}';
this.page.api_key = '{{config('disqus.api_key')}}';
// This adds the custom login/logout functionality
this.sso = {
name: "{{ config('app.name') }}",
url: "{{ route('login') }}",
logout: "{{ route('logout') }}"
// This adds the custom login/logout functionality
this.sso = {
name: "{{ config('app.name') }}",
url: "{{ route('login') }}",
logout: "{{ route('logout') }}"
};
};
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = '//{{config('disqus.domain')}}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
@endif
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = '//{{config('disqus.domain')}}.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
@endif
@append
<noscript>
<div class="alert alert-info" role="alert">
@lang('common.comments_no_js_message')
Expand Down

0 comments on commit c993e77

Please sign in to comment.