Просмотр исходного кода

[DOCS] Add TOC to landing page (#97437)

- Adds the TOC to the Elasticsearch docs landing page. Removes the right sidebar from the landing page.
- Removes the "View all Elastic docs" link from the bottom of the landing page

Co-authored-by: Abdon Pijpelink <abdon.pijpelink@elastic.co>
James Rodewig 2 лет назад
Родитель
Сommit
0781e60b19
2 измененных файлов с 19 добавлено и 1 удалено
  1. 2 0
      docs/reference/index.asciidoc
  2. 17 1
      docs/reference/landing-page.asciidoc

+ 2 - 0
docs/reference/index.asciidoc

@@ -11,6 +11,8 @@
 include::../Versions.asciidoc[]
 include::links.asciidoc[]
 
+include::landing-page.asciidoc[]
+
 include::intro.asciidoc[]
 
 include::release-notes/highlights.asciidoc[]

+ 17 - 1
docs/reference/index-custom-title-page.html → docs/reference/landing-page.asciidoc

@@ -1,3 +1,4 @@
+++++
 <style>
   * {
     box-sizing: border-box;
@@ -240,4 +241,19 @@
   </div>
 </div>
 
-<p class="my-4"><a href="https://www.elastic.co/guide/index.html">View all Elastic docs</a></p>
+<script>
+window.addEventListener("DOMContentLoaded", (event) => {
+  const left_col = document.getElementById("left_col")
+  left_col.classList.remove('col-0')
+  left_col.classList.add("col-12", "order-2", "col-md-4", "col-lg-3", "h-almost-full-md", "sticky-top-md")
+  const right_col = document.getElementById("right_col")
+  right_col.classList.add('d-none')
+  const middle_col = document.getElementById("middle_col")
+  middle_col.classList.remove("col-lg-7")
+  middle_col.classList.add("col-lg-9", "col-md-8")
+  const toc = middle_col.getElementsByClassName("toc")[0]
+  toc.remove()
+  left_col.appendChild(toc);
+});
+</script>
+++++