From 9f9146bc1e72eb672365d582e0cb0f52913544e1 Mon Sep 17 00:00:00 2001 From: Felix Hennig Date: Tue, 17 Jan 2023 17:37:29 +0100 Subject: [PATCH 1/2] Render navbar from site.keys instead of with supplemental UI --- preview-src/ui-model.yml | 25 +++++++++++++++++++++++++ src/helpers/isString.js | 3 +++ src/partials/navbar.hbs | 14 ++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 src/helpers/isString.js create mode 100644 src/partials/navbar.hbs diff --git a/preview-src/ui-model.yml b/preview-src/ui-model.yml index 9fa2e1a..2ea803c 100644 --- a/preview-src/ui-model.yml +++ b/preview-src/ui-model.yml @@ -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 diff --git a/src/helpers/isString.js b/src/helpers/isString.js new file mode 100644 index 0000000..64154c4 --- /dev/null +++ b/src/helpers/isString.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = (s) => typeof s === "string" diff --git a/src/partials/navbar.hbs b/src/partials/navbar.hbs new file mode 100644 index 0000000..3504b39 --- /dev/null +++ b/src/partials/navbar.hbs @@ -0,0 +1,14 @@ +{{#each site.keys.navbar}} + {{#if (isString this)}} + {{ @key }} + {{else}} + + {{/if}} +{{/each}} \ No newline at end of file From 66828af5dc402b045a87215f2256117262c90ae1 Mon Sep 17 00:00:00 2001 From: Felix Hennig Date: Tue, 17 Jan 2023 17:40:49 +0100 Subject: [PATCH 2/2] linter fix --- src/helpers/isString.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/isString.js b/src/helpers/isString.js index 64154c4..59e137a 100644 --- a/src/helpers/isString.js +++ b/src/helpers/isString.js @@ -1,3 +1,3 @@ 'use strict' -module.exports = (s) => typeof s === "string" +module.exports = (s) => typeof s === 'string'