Skip to content

Commit 0d7d273

Browse files
authored
chore: more redirects to grafana.com (#182)
* more redirects * improvement
1 parent 75b4ea9 commit 0d7d273

File tree

2 files changed

+42
-35
lines changed

2 files changed

+42
-35
lines changed

create-redirects.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
require 'json'
22

33
JSON.parse(File.read("redirects.json")).each_pair do |from, to|
4-
from = from.sub(/^\//, "").sub(/\/$/, "")
54
next if to == ""
65

6+
# normalize it first
7+
from = from.sub(/^\//, "").sub(/\/$/, "")
8+
# add slash unless this is root
9+
key = [from, "index.html"].reject { |x| x == "" }.join("/")
10+
711
puts "Redirect 301 #{from} #{to}"
812
system(
913
"aws", "s3api", "put-object",
1014
"--bucket", "pyroscope.io",
11-
"--key", "#{from}/index.html",
15+
"--key", key,
1216
"--body", "static/slack/index.html",
1317
"--website-redirect-location", to)
1418
end

redirects.json

Lines changed: 36 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,66 @@
11
{
2-
"docs/admin-server-delete-app": "",
3-
"docs/admin-server": "",
4-
"docs/agent-configuration-adhoc": "",
5-
"docs/agent-configuration-agent": "",
6-
"docs/agent-configuration-connect": "",
7-
"docs/agent-configuration-exec": "",
8-
"docs/agent-configuration-overview": "",
9-
"docs/agent-install-linux": "",
10-
"docs/agent-install-macos": "",
11-
"docs/agent-install-windows": "",
12-
"docs/agent-overview": "",
13-
"docs/api-key-authentication": "",
14-
"docs/ci": "",
15-
"docs/data-retention": "",
16-
"docs/docker-compose": "",
17-
"docs/docker-guide": "",
18-
"docs/flamegraph-com": "",
19-
"docs/flameql": "",
20-
"docs/golang-tracing": "",
21-
"docs/java-tracing": "",
22-
"docs/metrics-export": "",
23-
"docs/new-integrations": "",
24-
"docs/php": "",
25-
"docs/remote-write": "",
26-
"docs/ruby-tracing": "",
27-
"docs/server-api-reference": "",
28-
"docs/server-install-linux": "",
29-
"docs/server-install-macos": "",
30-
"docs/server-overview": "",
31-
"docs/storage-design": "",
32-
"docs/style-guide": "",
33-
"docs/troubleshooting-faq": "",
2+
"docs": "https://grafana.com/docs/pyroscope/latest/",
3+
"docs/admin-server-delete-app": "https://grafana.com/docs/pyroscope/latest/",
4+
"docs/admin-server": "https://grafana.com/docs/pyroscope/latest/",
5+
"docs/agent-configuration-adhoc": "https://grafana.com/docs/pyroscope/latest/",
6+
"docs/agent-configuration-agent": "https://grafana.com/docs/pyroscope/latest/",
7+
"docs/agent-configuration-connect": "https://grafana.com/docs/pyroscope/latest/",
8+
"docs/agent-configuration-exec": "https://grafana.com/docs/pyroscope/latest/",
9+
"docs/agent-configuration-overview": "https://grafana.com/docs/pyroscope/latest/",
10+
"docs/agent-install-linux": "https://grafana.com/docs/pyroscope/latest/",
11+
"docs/agent-install-macos": "https://grafana.com/docs/pyroscope/latest/",
12+
"docs/agent-install-windows": "https://grafana.com/docs/pyroscope/latest/",
3413
"docs/agent-kubernetes": "https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/helm/",
14+
"docs/agent-overview": "https://grafana.com/docs/pyroscope/latest/",
15+
"docs/api-key-authentication": "https://grafana.com/docs/pyroscope/latest/",
3516
"docs/architecture": "https://grafana.com/docs/pyroscope/latest/reference-pyroscope-architecture/",
3617
"docs/auth-github": "https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/github/",
3718
"docs/auth-gitlab": "https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/gitlab/",
3819
"docs/auth-google": "https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/google/",
3920
"docs/auth-internal": "https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/",
4021
"docs/auth-overview": "https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/",
4122
"docs/aws-lambda": "https://github.com/grafana/pyroscope-lambda-extension",
23+
"docs/ci": "https://grafana.com/docs/pyroscope/latest/",
24+
"docs/data-retention": "https://grafana.com/docs/pyroscope/latest/",
4225
"docs/deployment": "https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/",
4326
"docs/developer-guide": "https://grafana.com/docs/pyroscope/latest/reference-pyroscope-architecture/",
27+
"docs/docker-compose": "https://grafana.com/docs/pyroscope/latest/",
28+
"docs/docker-guide": "https://grafana.com/docs/pyroscope/latest/",
4429
"docs/dotnet-old": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/dotnet/",
4530
"docs/dotnet": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/dotnet/",
4631
"docs/ebpf": "https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/ebpf/",
32+
"docs/flamegraph-com": "https://grafana.com/docs/pyroscope/latest/",
33+
"docs/flameql": "https://grafana.com/docs/pyroscope/latest/",
4734
"docs/golang-old": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/go_push/",
4835
"docs/golang-pull-mode": "https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/go_pull/",
36+
"docs/golang-tracing": "https://grafana.com/docs/pyroscope/latest/",
4937
"docs/golang": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/go_push/",
5038
"docs/grafana-plugins": "https://grafana.com/docs/grafana/latest/datasources/grafana-pyroscope/",
5139
"docs/how-pyroscope-works": "https://grafana.com/docs/pyroscope/latest/get-started/",
5240
"docs/installing-pyroscope-overview": "https://grafana.com/docs/pyroscope/latest/get-started/",
41+
"docs/java-tracing": "https://grafana.com/docs/pyroscope/latest/",
5342
"docs/java": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/java/",
5443
"docs/kubernetes-helm-chart": "https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/helm/",
44+
"docs/metrics-export": "https://grafana.com/docs/pyroscope/latest/",
45+
"docs/new-integrations": "https://grafana.com/docs/pyroscope/latest/",
5546
"docs/nodejs": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/nodejs/",
47+
"docs/php": "https://grafana.com/docs/pyroscope/latest/",
5648
"docs/python": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/python/",
49+
"docs/remote-write": "https://grafana.com/docs/pyroscope/latest/",
50+
"docs/ruby-tracing": "https://grafana.com/docs/pyroscope/latest/",
5751
"docs/ruby": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/ruby/",
5852
"docs/rust": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/rust/",
53+
"docs/server-api-reference": "https://grafana.com/docs/pyroscope/latest/",
5954
"docs/server-configuration": "https://grafana.com/docs/pyroscope/latest/configure-server/",
55+
"docs/server-install-linux": "https://grafana.com/docs/pyroscope/latest/",
56+
"docs/server-install-macos": "https://grafana.com/docs/pyroscope/latest/",
6057
"docs/server-kubernetes": "https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/",
58+
"docs/server-overview": "https://grafana.com/docs/pyroscope/latest/",
59+
"docs/storage-design": "https://grafana.com/docs/pyroscope/latest/",
60+
"docs/style-guide": "https://grafana.com/docs/pyroscope/latest/",
6161
"docs/supported-integrations": "https://grafana.com/docs/pyroscope/latest/configure-client/",
62-
"downloads": "https://github.com/grafana/pyroscope/releases"
62+
"docs/tags": "https://grafana.com/docs/pyroscope/latest/",
63+
"docs/troubleshooting-faq": "https://grafana.com/docs/pyroscope/latest/",
64+
"downloads": "https://github.com/grafana/pyroscope/releases",
65+
"pricing": "https://grafana.com/auth/sign-up/create-user?src=pyroscope"
6366
}

0 commit comments

Comments
 (0)