Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axilleas@axilleas.me>2017-09-05 16:40:00 +0300
committerAchilleas Pipinellis <axilleas@axilleas.me>2017-09-05 16:40:53 +0300
commitde18d9ed1819852f3c0d03d703bafefc8b0c1474 (patch)
tree412ef1a239b62d5c8b161d6b65690482e736c053 /layouts
parentdf1e4754e46ffb130973dafc4cb10477c9b348df (diff)
Exclude CE docs from being indexed in Discourse comments
Diffstat (limited to 'layouts')
-rw-r--r--layouts/default.html4
-rw-r--r--layouts/discourse.html24
2 files changed, 15 insertions, 13 deletions
diff --git a/layouts/default.html b/layouts/default.html
index 4996af41..b582e08e 100644
--- a/layouts/default.html
+++ b/layouts/default.html
@@ -23,9 +23,7 @@
<div class="edit-on">
<%= edit_on_gitlab(@item) %>
</div>
- <% if @item[:comments].nil? %>
- <%= render '/discourse.*' %>
- <% end %>
+ <%= render '/discourse.*' %>
</div>
<div class="clear"></div>
</div>
diff --git a/layouts/discourse.html b/layouts/discourse.html
index b373bf44..17d98db7 100644
--- a/layouts/discourse.html
+++ b/layouts/discourse.html
@@ -1,11 +1,15 @@
-<div id='discourse-comments'></div>
-<script type="text/javascript">
- DiscourseEmbed = { discourseUrl: 'https://forum.gitlab.com/',
- discourseEmbedUrl: '<%= @config[:base_url] %><%= @item.identifier.without_ext + '.html' %>' };
+<% if @item[:comments].nil? %>
+ <% unless @item.identifier.to_s.split('/')[1] == 'ce' %>
+ <div id='discourse-comments'></div>
+ <script type="text/javascript">
+ DiscourseEmbed = { discourseUrl: 'https://forum.gitlab.com/',
+ discourseEmbedUrl: '<%= @config[:base_url] %><%= @item.identifier.without_ext + '.html' %>' };
- (function() {
- var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
- d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
- (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
- })();
-</script>
+ (function() {
+ var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
+ d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
+ })();
+ </script>
+ <% end %>
+<% end %>