Skip to content

Commit

Permalink
Add Enterprise only badge under the title based on metadata (tier)
Browse files Browse the repository at this point in the history
and remove the section from the info box

The information related to the tier is set in gateway's metadata file.
  • Loading branch information
fabianrbz committed Sep 23, 2024
1 parent 1497c6b commit 4849527
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 29 deletions.
5 changes: 5 additions & 0 deletions app/_data/products/gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ topologies:
- traditional
- hybrid
- db-less

tiers:
enterprise:
text: Enterprise only
url: '/gateway/enterprise/'
4 changes: 0 additions & 4 deletions app/_includes/info_box/how-to.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
{% include info_box/sections/works_on.html works_on=page.works_on %}
{% endif %}

{% if page.tier %}
{% include info_box/sections/tier.html tier=page.tier %}
{% endif %}

{% if page.plugins %}
{% include info_box/sections/plugins.html plugins=page.plugins %}
{% endif %}
Expand Down
4 changes: 0 additions & 4 deletions app/_includes/info_box/plugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
{% include info_box/sections/works_on.html works_on=page.works_on %}
{% endif %}

{% if page.tier %}
{% include info_box/sections/tier.html tier=page.tier %}
{% endif %}

{% if page.topologies %}
{% include info_box/sections/topologies.html topologies=page.topologies %}
{% endif %}
Expand Down
6 changes: 0 additions & 6 deletions app/_includes/info_box/sections/tier.html

This file was deleted.

43 changes: 29 additions & 14 deletions app/_includes/uses.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
{% if include.products or include.tools %}
{% if include.products or include.tools or include.tier %}
<div class="flex gap-2 items-center">
<span>Uses: </span>
{% if include.tier %}
{% assign tier = site.data.products.gateway.tiers[include.tier] %}
{% include badge.html url=tier.url text=tier.text %}
{% endif %}

{% if include.tier %}
{% if include.products or include.tools %}
<span class="text-sm"> and uses: </span>
{% endif %}
{% else %}
<span class="text-sm">Uses: </span>
{% endif %}

{% for product in include.products %}
{% assign product_info = site.data.products[product] %}
{% capture url %}/{{ product }}/{% endcapture %}
{% include badge.html url=url text=product_info.name %}
{% endfor %}
{% if include.products %}
{% for product in include.products %}
{% assign product_info = site.data.products[product] %}
{% capture url %}/{{ product }}/{% endcapture %}
{% include badge.html url=url text=product_info.name %}
{% endfor %}
{% endif %}

{% if include.products and include.tools %}
<span class="bg-brand-saturated/40 w-[1px] h-3/4"></span>
{% endif %}

{% assign tools = include.tools | sort %}
{% for tool in tools %}
{% assign tool_info = site.data.tools[tool] %}
{% if tool_info %}
{% capture url %}/{{ tool }}/{% endcapture %}
{% include badge.html url=url text=tool_info.name %}
{% if include.tools %}
{% assign tools = include.tools | sort %}
{% for tool in tools %}
{% assign tool_info = site.data.tools[tool] %}
{% if tool_info %}
{% capture url %}/{{ tool }}/{% endcapture %}
{% include badge.html url=url text=tool_info.name %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
</div>
{% endif %}
2 changes: 1 addition & 1 deletion app/_layouts/with_aside.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<h1>{{ page.title }}</h1>

{% include uses.html products=page.products tools=page.tools %}
{% include uses.html products=page.products tools=page.tools tier=page.tier %}

{% ifhascontent nav_header %}
<section class="flex">
Expand Down

0 comments on commit 4849527

Please sign in to comment.