Skip to content

Render navbar from site.keys instead of with supplemental UI #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions preview-src/ui-model.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@ site:
url: http://localhost:5252
title: Brand Docs
homeUrl: &home_url /xyz/5.2/index.html
keys:
navbar:
"Home": "/home/stable/index.html"
"Getting Started": "/home/stable/getting_started.html"
"Concept": "/home/stable/concepts/index.html"
"Tutorials": "/home/stable/tutorials/index.html"
"stackablectl": "/stackablectl/stable/index.html"
"Operators":
"Overview": "/home/stable/operators/index.html"
"Apache Airflow": "/airflow/stable/index.html"
"Apache Druid": "/druid/stable/index.html"
"Apache HBase": "/hbase/stable/index.html"
"Apache Hadoop HDFS": "/hdfs/stable/index.html"
"Apache Hive": "/hive/stable/index.html"
"Apache Kafka": "/kafka/stable/index.html"
"Apache NiFi": "/nifi/stable/index.html"
"Apache Spark on K8S": "/spark-k8s/stable/index.html"
"Apache Superset": "/superset/stable/index.html"
"Trino": "/trino/stable/index.html"
"Apache ZooKeeper": "/zookeeper/stable/index.html"
"OpenPolicyAgent": "/opa/stable/index.html"
"Commons": "/commons-operator/stable/index.html"
"Secret": "/secret-operator/stable/index.html"
"Listener": "/listener-operator/stable/index.html"
"Contribute": "/home/stable/contributor/index.html"
components:
- name: abc
title: Project ABC
Expand Down
3 changes: 3 additions & 0 deletions src/helpers/isString.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict'

module.exports = (s) => typeof s === 'string'
14 changes: 14 additions & 0 deletions src/partials/navbar.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{#each site.keys.navbar}}
{{#if (isString this)}}
<a class="navbar-sub-item" href="{{{ relativize this }}}">{{ @key }}</a>
{{else}}
<div class="navbar-sub-item drop-down">
{{ @key }}
<div class="drop-down-content">
{{#each this}}
<a class="drop-down-item" href="{{{ relativize this }}}">{{ @key }}</a>
{{/each}}
</div>
</div>
{{/if}}
{{/each}}