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

Add redirect rules for main spec 404s #3410

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
19 changes: 19 additions & 0 deletions content/en/docs/specs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,23 @@ title: Specifications
linkTitle: Specs
aliases: [/docs/reference, /docs/specification]
weight: 100
# Temporary redirect rules until they are added to the spec pages
redirects:
# OTel spec
- from: otel/logs/semantic_conventions/events
to: semconv/general/events/
- from: otel/trace/semantic_conventions/http
to: semconv/http/http-spans/
# Temporarily implement a catch-all for the rest. Later we'll add specific redirects like the one above.
- from: otel/logs/semantic_conventions/*
to: semconv/general/logs/
- from: otel/metrics/semantic_conventions/*
to: semconv/general/metrics/
- from: otel/resource/semantic_conventions/*
to: semconv/resource/
- from: otel/trace/semantic_conventions/*
to: semconv/general/trace/
# Semconv
- from: semconv/resource/deployment_environment
to: semconv/resource/deployment-environment
---
2 changes: 1 addition & 1 deletion content/en/docs/specs/status.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ same as the **Protocol** status.
active development.

[baggage]: /docs/specs/otel/baggage/
[event semantic conventions]: /docs/specs/semconv/general/logs/
[event semantic conventions]: /docs/specs/semconv/general/events/
[logging]: /docs/specs/otel/logs/
[logs data model]: /docs/specs/otel/logs/data-model/
[metrics]: /docs/specs/otel/metrics/
Expand Down
2 changes: 1 addition & 1 deletion content/en/ecosystem/registry/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description: >-
# self-loop with `/ecosystem/registry/index.html`. So we use the following
# redirect rule to avoid the loop, as suggested by Netlify support
# (email support ID 159489):
redirects: [{ from: ./*, to: '?' }]
redirects: [{ from: /ecosystem/registry*, to: '/ecosystem/registry?' }]
aliases: [/registry/*]
type: default
layout: registry
Expand Down
11 changes: 5 additions & 6 deletions layouts/index.redirects
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
{{ range $p := .Site.Pages -}}

{{ range $p.Params.redirects -}}
{{ $permaLink := $p.RelPermalink | strings.TrimSuffix "/" -}}
{{ $from := cond
(strings.HasPrefix .from "./")
(print $permaLink (strings.TrimPrefix "./" .from))
.from -}}
{{ $permaLink := $p.RelPermalink -}}
{{ $from := cond (strings.HasPrefix .from "/")
.from
(print $permaLink .from) -}}
{{ $to := cond (strings.HasPrefix .to "/")
.to
(print $permaLink .to) -}}
Expand Down Expand Up @@ -46,4 +45,4 @@

{{ $og_image_current := `/img/social/logo-wordmark-001.png` -}}

/featured-background.jpg {{ $og_image_current }} {{/* homepage og:image used prior to 2022/08 */}}
/featured-background.jpg {{ $og_image_current }} {{- /* homepage og:image used prior to 2022/08 */}}