diff --git a/app/_data/schemas/frontmatter/base.json b/app/_data/schemas/frontmatter/base.json index 30faa6ae..cfc3d782 100644 --- a/app/_data/schemas/frontmatter/base.json +++ b/app/_data/schemas/frontmatter/base.json @@ -45,8 +45,7 @@ "kic", "terraform", "admin-api", - "konnect-api", - "ui" + "konnect-api" ] } }, diff --git a/app/_gateway_entities/consumer.md b/app/_gateway_entities/consumer.md index fba93a98..6cdc8f13 100644 --- a/app/_gateway_entities/consumer.md +++ b/app/_gateway_entities/consumer.md @@ -67,7 +67,6 @@ tools: - konnect-api - kic - deck - - ui - terraform api_specs: diff --git a/app/_gateway_entities/consumer_group.md b/app/_gateway_entities/consumer_group.md index e5c0ed7a..981b6583 100644 --- a/app/_gateway_entities/consumer_group.md +++ b/app/_gateway_entities/consumer_group.md @@ -13,7 +13,6 @@ tools: - konnect-api - kic - deck - - ui - terraform tier: enterprise diff --git a/app/_gateway_entities/route.md b/app/_gateway_entities/route.md index a9cdd489..b95a75c5 100644 --- a/app/_gateway_entities/route.md +++ b/app/_gateway_entities/route.md @@ -20,7 +20,6 @@ tools: - konnect-api - kic - deck - - ui - terraform schema: diff --git a/app/_gateway_entities/service.md b/app/_gateway_entities/service.md index 96f4cac4..c0aaf3db 100644 --- a/app/_gateway_entities/service.md +++ b/app/_gateway_entities/service.md @@ -18,7 +18,6 @@ tools: - konnect-api - kic - deck - - ui - terraform schema: diff --git a/app/_gateway_entities/target.md b/app/_gateway_entities/target.md index dbbcafc0..37431a45 100644 --- a/app/_gateway_entities/target.md +++ b/app/_gateway_entities/target.md @@ -10,7 +10,6 @@ tools: - konnect-api - kic - deck - - ui - terraform description: A target identifies a specific instance of an upstream service. diff --git a/app/_gateway_entities/upstream.md b/app/_gateway_entities/upstream.md index c9ce7f64..37ee8a01 100644 --- a/app/_gateway_entities/upstream.md +++ b/app/_gateway_entities/upstream.md @@ -9,7 +9,6 @@ tools: - admin-api - kic - deck - - ui - terraform description: An upstream refers to the service applications sitting behind Kong Gateway, to which client requests are forwarded. diff --git a/app/_gateway_entities/workspace.md b/app/_gateway_entities/workspace.md index 640d66a9..db38796d 100644 --- a/app/_gateway_entities/workspace.md +++ b/app/_gateway_entities/workspace.md @@ -11,7 +11,6 @@ tools: - admin-api - kic - deck - - ui - terraform tier: enterprise diff --git a/app/_plugins/blocks/entity_example.rb b/app/_plugins/blocks/entity_example.rb index d6e86fe9..bce80abc 100644 --- a/app/_plugins/blocks/entity_example.rb +++ b/app/_plugins/blocks/entity_example.rb @@ -4,19 +4,19 @@ module Jekyll class EntityExample < Liquid::Block - def render(context) # rubocop:disable Metrics/MethodLength + def render(context) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize @context = context @site = context.registers[:site] @page = context.environments.first['page'] - environment = context.environments.first contents = super example = YAML.load(contents) - example = example.merge('formats' => @page['tools']) unless example['formats'] + example = example.merge('formats' => formats(@page)) unless example['formats'] unless example['formats'] - raise ArgumentError, "Missing key `tools` in metadata, or `formats` in entity_example block on page #{@page['path']}" + raise ArgumentError, + "Missing key `tools` in metadata, or `formats` in entity_example block on page #{@page['path']}" end entity_example = EntityExampleBlock::Base.make_for(example: example) @@ -30,11 +30,17 @@ def render(context) # rubocop:disable Metrics/MethodLength end rescue Psych::SyntaxError => e message = <<~STRING - On `#{@page['path']}`, the following {% entity_example %} block contains a malformed yaml: - #{contents.strip.split("\n").each_with_index.map { |l, i| "#{i}: #{l}" }.join("\n")} - #{e.message} + On `#{@page['path']}`, the following {% entity_example %} block contains a malformed yaml: + #{contents.strip.split("\n").each_with_index.map { |l, i| "#{i}: #{l}" }.join("\n")} + #{e.message} STRING - raise ArgumentError.new(message) + raise ArgumentError, message + end + + def formats(page) + return page['tools'] unless page['layout'] == 'gateway_entity' + + page['tools'].dup << 'ui' end end end