diff options
author | sptaule <lecas83@gmail.com> | 2022-01-27 18:10:37 +0100 |
---|---|---|
committer | sptaule <lecas83@gmail.com> | 2022-01-27 18:10:37 +0100 |
commit | 1da8b90340235753b935a880d797cb796700d151 (patch) | |
tree | e6c98c0999eb3b58e3ebfd72b88c4379a8fa51d0 /templates | |
parent | a8d6c4635cf4e49320ebee8ee6f348769b65ffa8 (diff) | |
download | garagehq.deuxfleurs.fr-1da8b90340235753b935a880d797cb796700d151.tar.gz garagehq.deuxfleurs.fr-1da8b90340235753b935a880d797cb796700d151.zip |
Doc refactor, doc and index QoL, fix search: working on every page
Diffstat (limited to 'templates')
-rwxr-xr-x | templates/base.html | 12 | ||||
-rw-r--r-- | templates/documentation.html | 2 | ||||
-rwxr-xr-x | templates/index.html | 24 | ||||
-rw-r--r-- | templates/partials/doc/global_toc.html | 18 | ||||
-rw-r--r-- | templates/partials/doc/page_toc.html | 6 | ||||
-rw-r--r-- | templates/partials/doc/toc_script.html | 23 | ||||
-rw-r--r-- | templates/partials/shared/nav.html | 16 |
7 files changed, 71 insertions, 30 deletions
diff --git a/templates/base.html b/templates/base.html index 8170b44..41121c3 100755 --- a/templates/base.html +++ b/templates/base.html @@ -18,9 +18,13 @@ </div> {% block search %} - <section id="search-modal" class="modal hidden bg-gray-50 w-5/6 md:w-4/5 lg:w-3/4 xl:w-2/3 2xl:w-1/2 absolute top-20 left-1/2 transform -translate-x-1/2 shadow-xl rounded-lg"> - <div class="p-2 md:p-4 xl:p-8"> + <section id="search-modal" class="modal hidden bg-gradient-to-b from-gray-50 to-gray-100 w-5/6 md:w-4/5 lg:w-3/4 xl:w-2/3 2xl:w-1/2 absolute top-20 left-1/2 transform -translate-x-1/2 shadow-2xl rounded-lg"> + <div class="p-2 md:p-4 xl:p-8 border-8 border-gray-300 rounded-lg shadow-inner" style="min-height:30vh;"> <section class="relative flex flex-col items-center justify-center"> + <div class="flexs items-center justify-center"> + <span class="text-xl inline-block font-thin">Search</span> + <span class="font-normal inline-block text-xs text-gray-500">(alt + S)</span> + </div> <div class="field mt-8 md:mt-0 mb-2"> <div class="control"> <input @@ -30,10 +34,10 @@ </div> </div> <div class="search-results hidden mt-8 p-2 md:p-4 w-full bg-white rounded shadow"> - <div class="search-results__items max-h-96 overflow-y-scroll p-2 md:p-4"></div> + <div class="search-results__items max-h-96 overflow-y-scroll p-2 md:p-4 focus:outline outline-garage-orange"></div> </div> </section> - <button aria-label="close" id="close-modal-btn" class="absolute top-2 right-2 flex items-center group rounded-full shadow-inner bg-gray-300 border border-transparent hover:border-gray-500 bg-opacity-50 p-2"> + <button aria-label="close" id="close-modal-btn" class="absolute top-4 right-4 flex items-center group rounded-full shadow-inner bg-gray-300 border border-transparent hover:border-gray-500 bg-opacity-50 p-2"> <svg id="close-modal-btn-icon" class="w-6 h-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg> <small class="text-xs text-gray-400">(Esc)</small> </button> diff --git a/templates/documentation.html b/templates/documentation.html index 70ef6a3..09dcad9 100644 --- a/templates/documentation.html +++ b/templates/documentation.html @@ -9,7 +9,7 @@ <section class="section overflow-x-hidden"> <div class="grid grid-cols-1 xl:grid-cols-5"> {% include "partials/doc/global_toc.html" %} - <div class="col-span-full xl:col-span-3"> + <div class="col-span-full xl:col-span-3" style="min-height:85vh;"> <article class="box my-12 px-6 lg:px-8 xl:px-12"> <div class="flex flex-col bg-gray-100 rounded-r shadow-sm w-full xl:w-max"> <div class="flex flex-col border-l-4 border-garage-orange py-2 px-4 relative"> diff --git a/templates/index.html b/templates/index.html index 08cce9c..83adef7 100755 --- a/templates/index.html +++ b/templates/index.html @@ -7,25 +7,25 @@ <div class="flex flex-col items-center justify-center py-12 px-12 xl:px-0"> <img src="{{ config.extra.organization.logo }}" width="220px" class="" /> <p class="text-gray-500 leading-10 pt-4 text-xl text-center">{{ config.extra.organization.description }}</p> - <div class="max-w-7xl mx-auto grid-cols-1 md:grid grid-cols-3 gap-x-32 py-12"> + <div class="max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-3 gap-x-32 py-12"> <div class="group flex flex-col items-start justify-center p-2"> - <img src="{{ get_url(path='images/host2.png') }}" class="transform group-hover:translate-y-4 transition duration-500"> - <span class="text-xl text-gray-700 font-semibold mt-4 transform group-hover:-translate-y-2 transition duration-500">Host a Website</span> + <img src="{{ get_url(path='images/host2.png') }}" class="transform group-hover:translate-y-2 transition duration-500"> + <span class="text-xl text-gray-700 font-semibold mt-4 transform group-hover:-translate-y-1 transition duration-500">Host a Website</span> </div> <div class="group flex flex-col items-center justify-center p-2"> - <img src="{{ get_url(path='images/store.png') }}" class="transform group-hover:translate-y-4 transition duration-500"> - <span class="text-xl text-gray-700 font-semibold mt-4 transform group-hover:-translate-y-2 transition duration-500">Store Media</span> + <img src="{{ get_url(path='images/store.png') }}" class="transform group-hover:translate-y-2 transition duration-500"> + <span class="text-xl text-gray-700 font-semibold mt-4 transform group-hover:-translate-y-1 transition duration-500">Store Media</span> </div> <div class="group flex flex-col items-end justify-center p-2"> - <img src="{{ get_url(path='images/backup.png') }}" class="transform group-hover:translate-y-4 transition duration-500"> - <span class="text-xl text-gray-700 font-semibold mt-4 transform group-hover:-translate-y-2 transition duration-500">Backup Target</span> + <img src="{{ get_url(path='images/backup.png') }}" class="transform group-hover:translate-y-2 transition duration-500"> + <span class="text-xl text-gray-700 font-semibold mt-4 transform group-hover:-translate-y-1 transition duration-500">Backup Target</span> </div> </div> </div> <div class="grid grid-cols-1 xl:grid-cols-2 gap-x-0 xl:gap-x-12 gap-y-24 text-garage-gray font-light bg-gray-100 py-12 w-full shadow-inner"> - <div class="flex flex-col items-center justify-center space-y-2"> + <div class="flex flex-col items-center justify-start space-y-2"> <h2 class="mb-2 text-2xl font-bold text-garage-orange leading-5">Our Goals</h2> <div class="w-8 h-1 bg-garage-orange"></div> <p class="text-center leading-5 italic">We made it lightweight and kept the efficiency in mind.</p> @@ -58,7 +58,7 @@ </ul> </div> - <div class="flex flex-col items-center justify-center space-y-2"> + <div class="flex flex-col items-center justify-start space-y-2"> <h2 class="mb-2 text-2xl font-bold text-garage-orange leading-5">Keeping requirements low</h2> <div class="w-8 h-1 bg-garage-orange"></div> <p class="text-center leading-5 italic"> @@ -103,7 +103,7 @@ </ul> </div> - <div class="flex flex-col items-center justify-center space-y-2 px-6 xl:px-0"> + <div class="flex flex-col items-center justify-start space-y-2 px-6 xl:px-0"> <h2 class="mb-2 text-2xl font-bold text-garage-orange leading-5">Data resiliency for everyone</h2> <div class="w-8 h-1 bg-garage-orange"></div> <p class="text-center leading-5 italic pb-4"> @@ -146,8 +146,8 @@ </ul> </div> - <div class="flex flex-col items-center justify-center space-y-2 px-6 xl:px-0"> - <h2 class="mb-2 text-2xl font-bold text-garage-orange leading-5">Built on the shoulder of giants</h2> + <div class="flex flex-col items-center justify-start space-y-2 px-6 xl:px-0"> + <h2 class="mb-2 text-2xl font-bold text-garage-orange leading-5">Standing on the shoulders of giants</h2> <div class="w-8 h-1 bg-garage-orange"></div> <p class="text-center leading-5 italic"> Lorem ipsum dolor sit amet consectetur adipisicing elit. diff --git a/templates/partials/doc/global_toc.html b/templates/partials/doc/global_toc.html index ebad287..f739f49 100644 --- a/templates/partials/doc/global_toc.html +++ b/templates/partials/doc/global_toc.html @@ -1,8 +1,20 @@ -<aside id="global_toc" class="col-span-1 h-max bg-gray-100 shadow-inner border-r border-t border-gray-200"> +<aside id="global_toc" class="relative col-span-1 h-full bg-gray-100 shadow-inner border-r border-t border-gray-200"> {% if section.subsections %} - <ul class="space-y-2 py-0.5 px-6 py-3 list-none"> + <ul id="main-toc-menu" class="space-y-2 px-6 py-3 list-none"> + + {% if section.pages %} + {% for page in section.pages %} + <a + href="{{ page.permalink | safe }}" + class="docPage block pl-2 py-1 border-l rounded-r border-garage-orange hover:bg-garage-orange hover:bg-opacity-20 + {% if current_path == page.path %} activePage border-l-4 text-garage-orange font-semibold border-opacity-100 border-garage-orange {% endif %}"> + {{ page.title }} + </a> + {% endfor %} + {% endif %} + {% for subsec in section.subsections %} - {% set h1 = get_section(path=subsec) %} + {% set h1 = get_section(path=subsec) %} <li class="relative"> <a href="{{ h1.permalink | safe }}" diff --git a/templates/partials/doc/page_toc.html b/templates/partials/doc/page_toc.html index 172e0ce..238d8c3 100644 --- a/templates/partials/doc/page_toc.html +++ b/templates/partials/doc/page_toc.html @@ -1,12 +1,12 @@ -<aside class="hidden 2xl:block fixed right-0 bottom-1/2 transform translate-y-1/2 col-span-1 h-auto bg-gray-100 rounded-l-lg shadow-inner"> +<aside class="hidden 2xl:block fixed right-0 bottom-1/2 transform translate-y-1/2 w-80 col-span-1 h-auto bg-gray-100 rounded-l-lg shadow-inner"> {% if page.toc %} <div class="w-full flex items-center justify-center py-1.5 bg-gray-200 rounded-tl-lg"> <span class="uppercase tracking-wide text-xs text-garage-gray">Page content</span> </div> - <ol class="text-sm space-y-0.5 py-0.5 px-8 py-3 list-decimal"> + <ol class="text-sm space-y-0.5 px-8 py-3 list-decimal"> {% for h1 in page.toc %} <li> - <a href="{{ h1.permalink | safe }}" class="font-semibold bg-gradient-to-r from-garage-gray to-garage-orange text-transparent bg-clip-text transition-all hover:text-garage-orange">{{ h1.title }}</a> + <a href="{{ h1.permalink | safe }}" class="font-semibold text-gray-800 transition-all hover:text-garage-orange">{{ h1.title }}</a> {% if h1.children %} <ul class="space-y-0.5 py-0.5"> {% for h2 in h1.children %} diff --git a/templates/partials/doc/toc_script.html b/templates/partials/doc/toc_script.html index a858c94..df115b0 100644 --- a/templates/partials/doc/toc_script.html +++ b/templates/partials/doc/toc_script.html @@ -1,9 +1,29 @@ -<script type="text/javascript"> +<script> const menuBarHeight = document.querySelector("nav.navbar").clientHeight; +const mainTocMenuWidth = document.getElementById('main-toc-menu').clientWidth; const tocItems = document.querySelectorAll(".toc"); const navSections = new Array(tocItems.length); + // Global ToC +/* + Fixed ToC when user scrolls. +*/ + +window.addEventListener('scroll', function() { + if (window.scrollY >= menuBarHeight) { + document.getElementById('main-toc-menu').classList.add('fixed', 'top-0', 'left-0'); + document.getElementById('main-toc-menu').style.width = mainTocMenuWidth + 'px'; + } else { + document.getElementById('main-toc-menu').classList.remove('fixed', 'top-0', 'left-0'); + } +}); + +// Page content +/* + Focus effect on current section anchor when user scrolls. +*/ + tocItems.forEach((el, i) => { let id = el.getAttribute("id").substring(5); navSections[i] = document.getElementById(id); @@ -42,7 +62,6 @@ window.addEventListener('scroll', () => { } }, false); -// If JS enabled, deploy only the current doc menu document.addEventListener("DOMContentLoaded", function() { var menusTriggers = document.getElementsByClassName("deploySubMenu"); var activeDocPage = document.getElementsByClassName("activePage")[0]; diff --git a/templates/partials/shared/nav.html b/templates/partials/shared/nav.html index 2489bf6..af46f2a 100644 --- a/templates/partials/shared/nav.html +++ b/templates/partials/shared/nav.html @@ -1,17 +1,17 @@ <nav aria-label="section navigation" class="navbar w-full" role="navigation"> - <div class="w-full flex flex-col space-y-2 md:space-y-0 md:flex-row items-center justify-between py-1 px-8 text-garage-gray bg-garage-orange bg-opacity-20"> + <div class="w-full flex flex-col space-y-2 md:space-y-0 md:flex-row items-center justify-between py-1.5 px-8 text-garage-gray bg-garage-orange bg-opacity-20"> <div class="navbar-brand"> <a class="hover:rounded-full hover:bg-white" href="{{config.base_url}}"> - <img class="transform duration-150 focus:bg-white hover:bg-white hover:shadow rounded-lg hover:scale-90" - src="{{ config.extra.organization.logo }}" width="65px"> + <img class="px-2 transform duration-150 focus:bg-white hover:bg-white hover:shadow rounded-lg" + src="{{ config.extra.organization.logo_horizontal }}" width="120px"> </a> </div> <div class="navbar-menu" id="navMenu"> - <div class="flex items-center justify-center"> + <div class="flex items-center justify-center space-x-2"> {% for item in config.extra.navbar_items %} {% if lang == item.code %} {% for nav in item.nav_items %} - <a class="font-semibold focus:bg-white hover:bg-white hover:shadow px-4 py-2 rounded-lg" + <a class="font-semibold focus:bg-white hover:bg-white hover:shadow px-3 py-1 rounded-lg" href="{{ nav.url | replace(from='$BASE_URL', to=config.base_url) }}"> {{ nav.name }} </a> @@ -25,6 +25,12 @@ class="focus:bg-white hover:bg-white hover:shadow px-4 py-2 rounded-lg"> <svg id="nav-search-btn-icon" class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path></svg> </button> + <a + href="https://garagehq.deuxfleurs.fr/_releases.html" + class="group flex items-center justify-center space-x-1 font-semibold shadow hover:bg-white hover:shadow px-2 py-1.5 rounded bg-orange-400 text-white hover:text-orange-400"> + <svg class="w-6 h-6 animate-pulse group-hover:animate-bounce" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10"></path></svg> + <span>Download</span> + </a> </div> </div> </div> |