diff options
author | Sarah German <sgerman@gitlab.com> | 2023-03-21 00:08:51 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2023-03-21 00:08:51 +0300 |
commit | a8af88ade5ef675d832ba9ce28bda1f30b525695 (patch) | |
tree | fedc409c2400e62b406d575f83c18695591aacb1 | |
parent | a6e1b5f4957bf33224f97f9a5814fe911ac57cf2 (diff) |
Remove Disqus commenting
-rw-r--r-- | Rules | 2 | ||||
-rw-r--r-- | content/assets/javascripts/disqus.js | 26 | ||||
-rw-r--r-- | content/assets/stylesheets/help.scss | 11 | ||||
-rw-r--r-- | content/frontend/feedback/feedback.js | 7 | ||||
-rw-r--r-- | layouts/comments.html | 26 | ||||
-rw-r--r-- | layouts/feedback.html | 21 |
6 files changed, 1 insertions, 92 deletions
@@ -45,8 +45,6 @@ preprocess do if item.identifier.match?('/ee/architecture/**/*.md') item[:layout] = 'blueprints/index' item[:feedback] = false - item[:comments] = false - item[:status] ||= 'proposed' end end diff --git a/content/assets/javascripts/disqus.js b/content/assets/javascripts/disqus.js deleted file mode 100644 index de2c7a60..00000000 --- a/content/assets/javascripts/disqus.js +++ /dev/null @@ -1,26 +0,0 @@ ---- -version: 1 ---- - -var disqus_config = function () { - this.page.url = '<%= @config[:base_url] %><%= @item.identifier.without_ext + '.html' %>'; - this.page.title = '<%= @item.key?(:title) ? "#{item[:title]} - GitLab Documentation" : "GitLab Documentation" %>'; -<% if @item[:disqus_identifier] %> - this.page.identifier = '<%= @item[:disqus_identifier] %>'; -<% else %> - this.page.identifier = '<%= @config[:base_url] %><%= @item.identifier.without_ext + '.html' %>'; -<% end %> -}; - -var is_disqus_loaded = false; -window.loadDisqus = function() { - if (!is_disqus_loaded){ - is_disqus_loaded = true; - var disqusThread = document.getElementById('disqus_thread'); - var d = document, s = d.createElement('script'); - disqusThread.innerHTML = ''; - s.src = 'https://gitlab-docs.disqus.com/embed.js'; - s.setAttribute('data-timestamp', +new Date()); - (d.head || d.body).appendChild(s); - } -}; diff --git a/content/assets/stylesheets/help.scss b/content/assets/stylesheets/help.scss index 7bc7caa3..18754596 100644 --- a/content/assets/stylesheets/help.scss +++ b/content/assets/stylesheets/help.scss @@ -99,14 +99,3 @@ } } } - -.disqus-comments-gitlab { - iframe { - padding-left: 1.067rem; - padding-right: 1.067rem; - background-color: $white; - border-radius: 0.333rem; - box-shadow: 0.133rem 0.133rem 0.467rem $search-border; - margin-top: 1.667rem; - } -} diff --git a/content/frontend/feedback/feedback.js b/content/frontend/feedback/feedback.js deleted file mode 100644 index 628c871e..00000000 --- a/content/frontend/feedback/feedback.js +++ /dev/null @@ -1,7 +0,0 @@ -document.addEventListener('DOMContentLoaded', () => { - const hasCommentAnchor = window.location.hash.includes('#comment-'); - - if (hasCommentAnchor) { - window.loadDisqus(); - } -}); diff --git a/layouts/comments.html b/layouts/comments.html deleted file mode 100644 index 28101679..00000000 --- a/layouts/comments.html +++ /dev/null @@ -1,26 +0,0 @@ -<% if production_and_default_branch? %> -<script type="text/javascript"> -var disqus_config = function () { - this.page.url = '<%= @config[:base_url] %><%= @item.identifier.without_ext + '.html' %>'; - this.page.title = '<%= @item.key?(:title) ? "#{item[:title]} - GitLab Documentation" : "GitLab Documentation" %>'; -<% if @item[:disqus_identifier] %> - this.page.identifier = '<%= @item[:disqus_identifier] %>'; -<% else %> - this.page.identifier = '<%= @config[:base_url] %><%= @item.identifier.without_ext + '.html' %>'; -<% end %> -}; - -var is_disqus_loaded = false; -window.loadDisqus = function() { - if (!is_disqus_loaded){ - is_disqus_loaded = true; - var disqusThread = document.getElementById('disqus_thread'); - var d = document, s = d.createElement('script'); - disqusThread.innerHTML = ''; - s.src = 'https://gitlab-docs.disqus.com/embed.js'; - s.setAttribute('data-timestamp', +new Date()); - (d.head || d.body).appendChild(s); - } -}; -</script> -<% end %> diff --git a/layouts/feedback.html b/layouts/feedback.html index 47cf91e7..482847a6 100644 --- a/layouts/feedback.html +++ b/layouts/feedback.html @@ -33,14 +33,6 @@ >Create an issue</a > to suggest an improvement to this page.<br /> - <%# Show comments only in production and on the default branch (hide archives) %> <% if - @item[:comments].nil? && production? && ENV['CI_COMMIT_REF_NAME'] == - ENV['CI_DEFAULT_BRANCH'] %> <% unless @item.identifier.to_s.split('/')[1] == 'ce' %> - <a class="help-and-feedback-link" href="#" onclick="loadDisqus();return false;" - >Show and post comments</a - > - to review and give feedback about this page. <% end %> <% end %> - <br /> </div> <div class="mt-3"> @@ -94,7 +86,7 @@ </p> <p class="mt-3"> If you want help with something specific and could use community support, - <a class="help-and-feedback-link" href="https://forum.gitlab.com/" target="_blank" + <a class="help-and-feedback-link" href="https://forum.gitlab.com/new-topic?title=topic%20title&body=topic%20body&tags=docs-feedback" target="_blank" >post on the GitLab forum</a >.<br /> </p> @@ -115,15 +107,4 @@ </div> </div> </div> - -<div id="disqus_thread" class="disqus-comments-gitlab"></div> - -<%= render '/comments.*' %> -<script src="<%= @items['/frontend/feedback/feedback.*'].path %>"></script> -<noscript - >Please enable JavaScript to view the - <a href="https://disqus.com/?ref_noscript" rel="nofollow" - >comments powered by Disqus.</a - ></noscript -> <% end %> |