Skip to content

Commit 9c761cd

Browse files
committed
Registry support for i18n
1 parent 458f7c5 commit 9c761cd

File tree

4 files changed

+35
-16
lines changed

4 files changed

+35
-16
lines changed

content/en/ecosystem/registry/_index.md

+15-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ title: Registry
33
description: >-
44
Find libraries, plugins, integrations, and other useful tools for using and
55
extending OpenTelemetry.
6+
type: default
7+
layout: registry
8+
body_class: registry td-content
9+
weight: 20
10+
11+
# =============================================================================
12+
# IMPORTANT:
13+
# IMPORTANT: Non-English locales: DO NOT include the front matter entries below
14+
# IMPORTANT:
15+
# =============================================================================
16+
17+
aliases: [/registry/*]
18+
outputs: [html, json]
19+
620
# The redirects and aliases implement catch-all rules for old registry entries;
721
# we don't publish individual entry pages anymore.
822
#
@@ -11,19 +25,13 @@ description: >-
1125
# redirect rule to avoid the loop, as suggested by Netlify support
1226
# (email support ID 159489):
1327
redirects: [{ from: /ecosystem/registry*, to: '/ecosystem/registry?' }]
14-
aliases: [/registry/*]
15-
type: default
16-
layout: registry
17-
outputs: [html, json]
18-
body_class: registry td-content
19-
weight: 20
2028
---
2129

2230
{{% blocks/lead color="dark" %}}
2331

2432
<!-- markdownlint-disable single-h1 -->
2533

26-
# {{% param title %}}
34+
<h1>{{% param title %}}</h1>
2735

2836
{{% param description %}}
2937

hugo.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,9 @@ module:
380380
source: content/en/docs
381381
target: content/docs
382382
lang: pt
383+
- source: content/en/ecosystem
384+
target: content/ecosystem
385+
lang: pt
383386

384387
## static
385388
- source: static

layouts/partials/ecosystem/registry/entry.html

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{ $languageNames := .languageNames -}}
2+
{{ $registryUrl := .registryUrl -}}
23

34
{{ with .value -}}
45
{{
@@ -116,18 +117,18 @@ <h4 class="card-title mb-0 d-flex flex-row">
116117
<span class="badge rounded-pill text-bg-info"><i class="fa-regular fa-star"></i> new</span>
117118
{{ end -}}
118119
{{ if $isNative -}}
119-
<a href="/ecosystem/registry?flag=native" class="badge rounded-pill text-bg-success text-white" title="Click to filter by native flag">
120+
<a href="{{ $registryUrl }}/?flag=native" class="badge rounded-pill text-bg-success text-white" title="Click to filter by native flag">
120121
<i class="fa-solid fa-puzzle-piece"></i> native</a>
121122
{{ end -}}
122123
{{ if $isFirstParty -}}
123-
<a href="/ecosystem/registry?flag=first_party" class="badge rounded-pill text-bg-success text-white" title="Click to filter by first party flag">
124+
<a href="{{ $registryUrl }}/?flag=first_party" class="badge rounded-pill text-bg-success text-white" title="Click to filter by first party flag">
124125
<i class="fa-solid fa-heart"></i> first party integration</a>
125126
{{ end -}}
126127
{{ if $usedInDemo -}}
127128
<span class="badge rounded-pill text-bg-secondary text-white" title="This package is used in the OpenTelemetry Demo!"><i class="fa-solid fa-shapes"></i> OTel Demo</span>
128129
{{ end -}}
129130
{{ if $deprecated -}}
130-
<a href="/ecosystem/registry?flag=deprecated" class="badge rounded-pill text-bg-danger text-white" title="Click to filter by deprecated flag">
131+
<a href="{{ $registryUrl }}/?flag=deprecated" class="badge rounded-pill text-bg-danger text-white" title="Click to filter by deprecated flag">
131132
<i class="fa-solid fa-ban"></i> deprecated</a>
132133
{{ end -}}
133134
{{ if .cncfProjectLevel -}}
@@ -171,7 +172,7 @@ <h4 class="alert-heading">Deprecated</h4>
171172
<div>
172173
{{ range .tags }}
173174
{{ $tag := . }} <!-- Store the tag in a variable -->
174-
<a href="/ecosystem/registry/?s={{ $tag | urlize }}" class="badge bg-light me-1">{{ $tag }}</a>
175+
<a href="{{ $registryUrl }}/?s={{ $tag | urlize }}" class="badge bg-light me-1">{{ $tag }}</a>
175176
{{ end }}
176177
</div>
177178
{{ end }}

layouts/shortcodes/ecosystem/registry/search-form.html

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{ $registry := .Site.Data.registry -}}
2+
{{ $registryUrl := .Page.RelPermalink -}}
23

34
{{ $languageNames := newScratch -}}
45
{{ $languageNames.Set "cpp" "C++" -}}
@@ -15,7 +16,7 @@
1516
{{- $val := (dict
1617
"name" .language
1718
"isOfficial" (in $officialLanguages .language)
18-
)
19+
)
1920
-}}
2021
{{ $langs = $langs | append $val -}}
2122
{{ if ne $language (lower $language) -}}
@@ -69,11 +70,12 @@
6970
<div class="alert alert-info">
7071
The OpenTelemetry Registry allows you to search for instrumentation libraries,
7172
collector components, utilities, and other useful projects in the OpenTelemetry
72-
ecosystem. If you are a project maintainer, you can <a href="/ecosystem/registry/adding/">add your project to the OpenTelemetry Registry</a>
73+
ecosystem. If you are a project maintainer, you can
74+
<a href="{{ $registryUrl }}adding/">add your project to the OpenTelemetry Registry</a>
7375
</div>
7476

7577
<div class="pb-4">
76-
<form action="/ecosystem/registry" id="searchForm">
78+
<form action="{{ $registryUrl }}" id="searchForm">
7779
<div class="input-group">
7880
<span class="input-group-text" id="basic-addon1" title="{{ len $registry }} entries">Search {{ len $registry }} entries</span>
7981
<input class="form-control w-auto" list="search-suggestions" id="input-s" type="text" name="s" placeholder="Type to search…"
@@ -123,7 +125,7 @@
123125
</div>
124126

125127
<!-- Flags Filter Dropdown -->
126-
<button class="btn btn-outline-secondary dropdown-toggle" id="flagsDropdown" type="button"
128+
<button class="btn btn-outline-secondary dropdown-toggle" id="flagsDropdown" type="button"
127129
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Flags</button>
128130
<div class="dropdown-menu" id="flagsFilter">
129131
<a value="all" class="dropdown-item">Any Flag</a>
@@ -145,7 +147,12 @@
145147
<ul class="list-unstyled" id="default-body">
146148
{{ range $key, $value := $registry -}}
147149
{{ $value = merge $value (dict "_key" $key) -}}
148-
{{ partial "ecosystem/registry/entry" (dict "value" $value "languageNames" $languageNames) }}
150+
{{ partial "ecosystem/registry/entry"
151+
(dict
152+
"registryUrl" $registryUrl
153+
"value" $value
154+
"languageNames" $languageNames
155+
) -}}
149156
{{ end -}}
150157
</ul>
151158
</div>

0 commit comments

Comments
 (0)