tzulitai commented on a change in pull request #73: [FLINK-16758][docs] Port StateFun Documentation to Jekyll URL: https://github.com/apache/flink-statefun/pull/73#discussion_r397614108
########## File path: docs/_includes/sidenav.html ########## @@ -0,0 +1,185 @@ +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +{%- comment -%} +============================================================================== +Extract the active nav IDs. +============================================================================== +{%- endcomment -%} + +{%- assign active_nav_ids = site.array -%} +{%- assign parent_id = page.nav-parent_id -%} + +{%- for i in (1..10) -%} + {%- if parent_id -%} + {%- assign active_nav_ids = active_nav_ids | push: parent_id -%} + {%- assign current = (site.pages_by_language[page.language] | where: "nav-id" , parent_id | sort: "nav-pos") -%} + {%- if current.size > 0 -%} + {%- assign parent_id = current[0].nav-parent_id -%} + {%- else -%} + {%- break -%} + {%- endif -%} + {%- else -%} + {%- break -%} + {%- endif -%} +{%- endfor -%} + +{%- if page.language == "en" -%} + {%- capture baseurl_i18n -%}{{ site.baseurl }}{%- endcapture -%} +{%- else if page.language == "zh" -%} + {%- capture baseurl_i18n -%}{{ site.baseurl }}/{{ page.language }}{%- endcapture -%} +{%- endif -%} + +{%- comment -%} +============================================================================== +Build the nested list from nav-id and nav-parent_id relations. +============================================================================== +This builds a nested list from all pages. The fields used to determine the +structure are: + +- 'nav-id' => ID of this page. Other pages can use this ID as their + parent ID. +- 'nav-parent_id' => ID of the parent. This page will be listed under + the page with id 'nav-parent_id'. + +Level 0 is made up of all pages, which have nav-parent_id set to 'root'. + +The 'title' of the page is used as the default link text. You can +override this via 'nav-title'. The relative position per navigational +level is determined by 'nav-pos'. +{%- endcomment -%} + +{%- assign elementsPosStack = site.array -%} +{%- assign posStack = site.array -%} + +{%- assign elements = site.array -%} +{%- assign all_pages_by_nav_parent = (site.pages_by_language[page.language] | where_exp: "item", "item.nav-parent_id != nil" | group_by: "nav-parent_id") -%} +{%- assign children = (all_pages_by_nav_parent | where: "name" , "root") -%} +{%- assign children = (children[0].items | sort: "nav-pos") -%} +{%- if children.size > 0 -%} + {%- assign elements = elements | push: children -%} +{%- endif -%} + +{%- assign elementsPos = 0 -%} +{%- assign pos = 0 -%} + +<div class="sidenav-logo"> + <p><a href="{{ baseurl_i18n }}/"><img class="bottom" alt="Apache Flink" src="{{ site.baseurl }}/page/img/navbar-brand-logo.jpg"></a> v{{ site.version_title }}</p> Review comment: I think we need to decide what we want put here as the logo.  It is definitely a bit weird looking at it now, that we're using the Flink squirrel logo here, because at first glance it looks like `Apache Flink v2.0-SNAPSHOT` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
