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:
-rw-r--r--content/assets/stylesheets/comments.scss13
-rw-r--r--layouts/default.html4
-rw-r--r--layouts/disqus.html19
-rw-r--r--layouts/head.html1
4 files changed, 36 insertions, 1 deletions
diff --git a/content/assets/stylesheets/comments.scss b/content/assets/stylesheets/comments.scss
new file mode 100644
index 000000000..aa2e868a8
--- /dev/null
+++ b/content/assets/stylesheets/comments.scss
@@ -0,0 +1,13 @@
+---
+version: 1
+---
+
+@import "variables";
+
+.comments {
+ margin-top: 15px;
+ padding-top: 10px;
+ border-top-style: solid;
+ border-top-color: $border-color;
+ border-top-width: 1px;
+}
diff --git a/layouts/default.html b/layouts/default.html
index db7ad3c28..887cd3a95 100644
--- a/layouts/default.html
+++ b/layouts/default.html
@@ -29,7 +29,9 @@
<em>Last updated <%= @item[:last_updated] %></em>
</p>
<% end %>
- <%= render '/discourse.*' %>
+ <div class="comments">
+ <%= render '/disqus.*' %>
+ </div>
</div>
<div class="clear"></div>
</div>
diff --git a/layouts/disqus.html b/layouts/disqus.html
new file mode 100644
index 000000000..5af3d7f7e
--- /dev/null
+++ b/layouts/disqus.html
@@ -0,0 +1,19 @@
+<% if @item[:comments].nil? %>
+ <% unless @item.identifier.to_s.split('/')[1] == 'ce' %>
+ <div id="disqus_thread"></div>
+ <script>
+ 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" %>';
+ };
+
+ (function() { // DON'T EDIT BELOW THIS LINE
+ var d = document, s = d.createElement('script');
+ s.src = 'https://gitlab-docs.disqus.com/embed.js';
+ s.setAttribute('data-timestamp', +new Date());
+ (d.head || d.body).appendChild(s);
+ })();
+ </script>
+ <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
+ <% end %>
+<% end %>
diff --git a/layouts/head.html b/layouts/head.html
index 4ead2b1d4..bf6ac6b2e 100644
--- a/layouts/head.html
+++ b/layouts/head.html
@@ -9,6 +9,7 @@
<link rel="stylesheet" href="<%= @items['/assets/stylesheets/footer.*'].path %>">
<link rel="stylesheet" href="<%= @items['/assets/stylesheets/docsearch.min.*'].path %>">
<link rel="stylesheet" href="<%= @items['/assets/stylesheets/toc.*'].path %>">
+ <link rel="stylesheet" href="<%= @items['/assets/stylesheets/comments.*'].path %>">
<script async src="<%= @items['/assets/javascripts/docs.*'].path %>"></script>
<link href='//fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,400italic' rel='stylesheet' type='text/css'>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">