Skip to content
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

[i18n/infra] Introduce include feature with fallback #6309

Merged
Merged
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
2 changes: 2 additions & 0 deletions .cspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ dictionaries:
words: # Valid words across all locales
- Docsy
- htmltest
# Hugo
- warnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: # Bogus entry for markdownlint
_build: { list: never, render: never }
---

{{% alert-md title=Warning color=warning %}}

Client instrumentation for the browser is **experimental** and mostly
**unspecified**. If you are interested in helping out, get in touch with the
[Client Instrumentation SIG][sig].

[sig]:
https://docs.google.com/document/d/16Vsdh-DM72AfMg_FIt9yT9ExEWF4A_vRbQ3jRNBe09w

{{% /alert-md %}}
3 changes: 1 addition & 2 deletions content/en/docs/languages/js/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ weight: 20

{{% docs/languages/index-intro js /%}}

{{% alert title="Warning" color="warning" %}}
{{% param notes.browser-instrumentation %}} {{% /alert %}}
{{% include browser-instrumentation-warning.md %}}

## Version Support

Expand Down
3 changes: 1 addition & 2 deletions content/en/docs/languages/js/getting-started/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ description: Learn how to add OpenTelemetry to your browser app
weight: 20
---

{{% alert title="Warning" color="warning" %}}
{{% param notes.browser-instrumentation %}} {{% /alert %}}
{{% include browser-instrumentation-warning.md %}}

While this guide uses the example application presented below, the steps to
instrument your own application should be similar.
Expand Down
3 changes: 1 addition & 2 deletions content/en/docs/languages/js/instrumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,7 @@ above, you have a `TracerProvider` setup for you already. You can continue with

#### Browser

{{% alert title="Warning" color="warning" %}}
{{% param notes.browser-instrumentation %}} {{% /alert %}}
{{% include browser-instrumentation-warning.md %}}

First, ensure you've got the right packages:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: # Bogus entry for markdownlint
_build: { list: never, render: never }
default_lang_commit: 0dac041dedfe5877f45e36065c1c6fb07490b243
---

{{% alert-md title=Aviso color=warning %}}

A instrumentação do cliente para o navegador é **experimental** e, em grande
parte, **não está especificada**. Caso possua interesse em auxiliar, entre em
contato com o [SIG de Instrumentação do Cliente][sig].

[sig]:
https://docs.google.com/document/d/16Vsdh-DM72AfMg_FIt9yT9ExEWF4A_vRbQ3jRNBe09w

{{% /alert-md %}}
3 changes: 1 addition & 2 deletions content/pt/docs/languages/js/getting-started/browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ weight: 20
default_lang_commit: 7cb1bd39726fc03698164ee17fe9087afdac054c
---

{{% alert title="Aviso" color="warning" %}}
{{% param notes.browser-instrumentation %}} {{% /alert %}}
{{% include browser-instrumentation-warning.md %}}

Embora este guia utilize o exemplo de aplicação apresentada abaixo, as etapas
para instrumentar a sua própria aplicação devem ser similares.
Expand Down
16 changes: 1 addition & 15 deletions hugo.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cSpell:ignore docsy goldmark linkify netlify wordmark noopener
# cSpell:ignore bluesky docsy goldmark linkify netlify wordmark noopener
baseURL: https://opentelemetry.io
title: OpenTelemetry
disableKinds: [taxonomy]
Expand Down Expand Up @@ -37,14 +37,6 @@ languages:
languageCode: pt-BR
params:
description: Site do Projeto OpenTelemetry
notes:
browser-instrumentation: |
A instrumentação do cliente para o navegador é **experimental** e,
em grande parte, **não está especificada**. Caso possua interesse em
auxiliar, entre em contato com o [SIG de Instrumentação do
Cliente][sig].

[sig]: https://docs.google.com/document/d/16Vsdh-DM72AfMg_FIt9yT9ExEWF4A_vRbQ3jRNBe09w
zh:
languageName: 中文 (Chinese)
languageCode: zh-cn
Expand Down Expand Up @@ -235,12 +227,6 @@ params:
docker-compose-v2: |
`docker-compose` is deprecated. For details, see
[Migrate to Compose V2](https://docs.docker.com/compose/migrate/).
browser-instrumentation: |
Client instrumentation for the browser is **experimental** and mostly **unspecified**.
If you are interested in helping out, get in touch with the
[Client Instrumentation SIG][sig].

[sig]: https://docs.google.com/document/d/16Vsdh-DM72AfMg_FIt9yT9ExEWF4A_vRbQ3jRNBe09w

security:
funcs: # cspell:disable-line
Expand Down
5 changes: 1 addition & 4 deletions layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,4 @@
{{- .Text | safeHTML -}}
</a>

{{- /*
cSpell:ignore warnf
This comment ensures that all trailing whitespace is trimmed.
*/ -}}
{{- /* Trim trailing whitespace */ -}}
14 changes: 14 additions & 0 deletions layouts/shortcodes/alert-md.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{/* Temporary, from Docsy */ -}}

{{ $color := .Get "color" | default "primary" -}}

<div class="alert alert-{{ $color }}" role="alert">
{{- with .Get "title" -}}
<div class="h4 alert-heading" role="heading">
{{- . | safeHTML -}}
</div>
{{/* Do **not** remove this comment! It ends the previous HTML block; see https://spec.commonmark.org/0.30/#html-blocks, 7. */}}
{{- end -}}
{{ .Inner -}}
</div>
{{/* */ -}}
27 changes: 27 additions & 0 deletions layouts/shortcodes/include.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{/* Use to include Markdown snippets. Note that the included content can have
calls to shortcodes. */ -}}

{{ $path := .Get 0 -}}
{{ if not (or
(strings.HasPrefix $path "/" )
(strings.HasPrefix $path "."))
-}}
{{ $path = printf "_includes/%s" $path -}}
{{ end -}}

{{ template "getPage" (dict "ctx" . "path" $path "page" .Page) -}}

{{ define "getPage" -}}
{{ $page_to_include := .page.GetPage .path -}}
{{ with $page_to_include -}}
{{ .Content -}}
{{ else -}}
{{ $parent := .page.Parent -}}
{{ if $parent -}}
{{ template "getPage" (dict "ctx" .ctx "path" .path "page" $parent) -}}
{{ else -}}
{{ warnf "File not found: %s in page: %s" .path .ctx.Page.Path -}}
**ERROR**: File not found: {{ .path }}.
{{end -}}
{{ end -}}
{{ end -}}
Loading