Repository: mesos
Updated Branches:
  refs/heads/master 37053061e -> 257cd8060


Added link anchors to all website headings.

This follows the example of the Middleman documentation and
uses AnchorJS to inject link anchors to all headings at page
load time. The styling is basic black to match the styling of
the header titles.

Review: https://reviews.apache.org/r/62980/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/257cd806
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/257cd806
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/257cd806

Branch: refs/heads/master
Commit: 257cd806038006818a4416e28b990843af770391
Parents: 3705306
Author: James Peach <jpe...@apache.org>
Authored: Wed Oct 18 13:33:08 2017 -0700
Committer: Greg Mann <gregorywm...@gmail.com>
Committed: Wed Oct 18 13:33:08 2017 -0700

----------------------------------------------------------------------
 site/source/assets/css/main.css | 11 +++++++++++
 site/source/layouts/basic.erb   | 13 +++++++++++++
 2 files changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/257cd806/site/source/assets/css/main.css
----------------------------------------------------------------------
diff --git a/site/source/assets/css/main.css b/site/source/assets/css/main.css
index 83596dd..d6ecb18 100755
--- a/site/source/assets/css/main.css
+++ b/site/source/assets/css/main.css
@@ -275,3 +275,14 @@ img {
 .share {
   display: block;
 }
+
+*:hover > .anchorjs-link {
+  text-decoration: none;
+  color: black;
+  font-size: 0.8em;
+}
+
+.anchorjs-link {
+  color: black;
+  font-size: 0.8em;
+}

http://git-wip-us.apache.org/repos/asf/mesos/blob/257cd806/site/source/layouts/basic.erb
----------------------------------------------------------------------
diff --git a/site/source/layouts/basic.erb b/site/source/layouts/basic.erb
index 3bf1f55..8a07488 100755
--- a/site/source/layouts/basic.erb
+++ b/site/source/layouts/basic.erb
@@ -112,5 +112,18 @@
     <!-- JS -->
     <%= javascript_include_tag '//code.jquery.com/jquery-1.11.0.min.js' %>
     <%= javascript_include_tag 
'//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js' %>
+    <%= javascript_include_tag 
'//cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js' %>
+
+    <!-- Inject anchors for all headings on the page, see 
https://www.bryanbraun.com/anchorjs. -->
+    <script type="text/javascript">
+    anchors.options = {
+      placement: 'right',
+      ariaLabel: 'Permalink',
+    };
+
+    // The default is to not add anchors to h1, but we have pages with 
multiple h1 headers,
+    // and we do want to put anchors on those.
+    anchors.add('h1, h2, h3, h4, h5, h6');
+    </script>
   </body>
 </html>

Reply via email to