diff options
-rw-r--r-- | lib/response.js | 6 | ||||
-rw-r--r-- | public/views/pretty.ejs | 2 | ||||
-rw-r--r-- | public/views/shared/ga.ejs | 2 | ||||
-rw-r--r-- | public/views/slide.ejs | 2 |
4 files changed, 7 insertions, 5 deletions
diff --git a/lib/response.js b/lib/response.js index dd33e42b..1313f9f4 100644 --- a/lib/response.js +++ b/lib/response.js @@ -226,7 +226,8 @@ function showPublishNote (req, res, next) { robots: meta.robots || false, // default allow robots GA: meta.GA, disqus: meta.disqus, - cspNonce: res.locals.nonce + cspNonce: res.locals.nonce, + dnt: req.headers.dnt } return renderPublish(data, res) }).catch(function (err) { @@ -608,7 +609,8 @@ function showPublishSlide (req, res, next) { robots: meta.robots || false, // default allow robots GA: meta.GA, disqus: meta.disqus, - cspNonce: res.locals.nonce + cspNonce: res.locals.nonce, + dnt: req.headers.dnt } return renderPublishSlide(data, res) }).catch(function (err) { diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs index 9604d422..1970ab2f 100644 --- a/public/views/pretty.ejs +++ b/public/views/pretty.ejs @@ -63,7 +63,7 @@ </div> </div> <div id="ui-toc-affix" class="ui-affix-toc ui-toc-dropdown unselectable hidden-print" data-spy="affix" style="display:none;"></div> - <% if(typeof disqus !== 'undefined' && disqus) { %> + <% if(typeof disqus !== 'undefined' && disqus && !dnt) { %> <div class="container-fluid" style="max-width: 758px; margin-bottom: 40px;"> <%- include shared/disqus %> </div> diff --git a/public/views/shared/ga.ejs b/public/views/shared/ga.ejs index 27abb742..f6b807fb 100644 --- a/public/views/shared/ga.ejs +++ b/public/views/shared/ga.ejs @@ -1,4 +1,4 @@ -<% if(typeof GA !== 'undefined' && GA) { %> +<% if(typeof GA !== 'undefined' && GA && !dnt) { %> <script nonce="<%= cspNonce %>"> (function (i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; diff --git a/public/views/slide.ejs b/public/views/slide.ejs index ff4be9e9..3331b85d 100644 --- a/public/views/slide.ejs +++ b/public/views/slide.ejs @@ -78,7 +78,7 @@ <% } %> </small> </div> - <% if(typeof disqus !== 'undefined' && disqus) { %> + <% if(typeof disqus !== 'undefined' && disqus && !dnt) { %> <div class="slides-disqus"> <%- include shared/disqus %> </div> |