From 925193eb6f2b98094a51d54309da95f23e6e094c Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Thu, 14 Feb 2019 22:28:43 +0100 Subject: [PATCH] Add page summary in the documentation --- website/template/default.twig | 17 ++++++++++++++--- website/template/styles.css | 6 ++++++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/website/template/default.twig b/website/template/default.twig index 1a3a9382f..2e65df59b 100644 --- a/website/template/default.twig +++ b/website/template/default.twig @@ -70,6 +70,10 @@ {% endblock %} + @@ -91,9 +95,16 @@ gtag('js', new Date()); gtag('config', 'UA-15584647-20'); - $('article h2, article h3, article h4, article h5').each(function () { - var url = document.URL.replace(/#.*$/, "") + '#' + $(this).attr('id'); - $(this).prepend(' #'); + $(function() { + $('article h2, article h3, article h4, article h5').each(function () { + var url = document.URL.replace(/#.*$/, "") + '#' + $(this).attr('id'); + $(this).prepend(' #'); + }); + $('article h2').each(function () { + var url = '#' + $(this).attr('id'); + var caption = $(this).text().substr(2); + $('#in-page-menu ul').append('
  • ' + caption + '
  • '); + }); }); diff --git a/website/template/styles.css b/website/template/styles.css index 4a3023fe9..4decaf0d6 100644 --- a/website/template/styles.css +++ b/website/template/styles.css @@ -168,3 +168,9 @@ article blockquote a { article blockquote p:first-child { margin-top: 0; } + +@media (min-width: 1360px) { + #in-page-menu { + display: block; + } +}