Skip to content

Commit

Permalink
chore: more redirects to grafana.com (#182)
Browse files Browse the repository at this point in the history
* more redirects

* improvement
  • Loading branch information
petethepig authored Oct 2, 2023
1 parent 75b4ea9 commit 0d7d273
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 35 deletions.
8 changes: 6 additions & 2 deletions create-redirects.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
require 'json'

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

# normalize it first
from = from.sub(/^\//, "").sub(/\/$/, "")
# add slash unless this is root
key = [from, "index.html"].reject { |x| x == "" }.join("/")

puts "Redirect 301 #{from} #{to}"
system(
"aws", "s3api", "put-object",
"--bucket", "pyroscope.io",
"--key", "#{from}/index.html",
"--key", key,
"--body", "static/slack/index.html",
"--website-redirect-location", to)
end
69 changes: 36 additions & 33 deletions redirects.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,66 @@
{
"docs/admin-server-delete-app": "",
"docs/admin-server": "",
"docs/agent-configuration-adhoc": "",
"docs/agent-configuration-agent": "",
"docs/agent-configuration-connect": "",
"docs/agent-configuration-exec": "",
"docs/agent-configuration-overview": "",
"docs/agent-install-linux": "",
"docs/agent-install-macos": "",
"docs/agent-install-windows": "",
"docs/agent-overview": "",
"docs/api-key-authentication": "",
"docs/ci": "",
"docs/data-retention": "",
"docs/docker-compose": "",
"docs/docker-guide": "",
"docs/flamegraph-com": "",
"docs/flameql": "",
"docs/golang-tracing": "",
"docs/java-tracing": "",
"docs/metrics-export": "",
"docs/new-integrations": "",
"docs/php": "",
"docs/remote-write": "",
"docs/ruby-tracing": "",
"docs/server-api-reference": "",
"docs/server-install-linux": "",
"docs/server-install-macos": "",
"docs/server-overview": "",
"docs/storage-design": "",
"docs/style-guide": "",
"docs/troubleshooting-faq": "",
"docs": "https://grafana.com/docs/pyroscope/latest/",
"docs/admin-server-delete-app": "https://grafana.com/docs/pyroscope/latest/",
"docs/admin-server": "https://grafana.com/docs/pyroscope/latest/",
"docs/agent-configuration-adhoc": "https://grafana.com/docs/pyroscope/latest/",
"docs/agent-configuration-agent": "https://grafana.com/docs/pyroscope/latest/",
"docs/agent-configuration-connect": "https://grafana.com/docs/pyroscope/latest/",
"docs/agent-configuration-exec": "https://grafana.com/docs/pyroscope/latest/",
"docs/agent-configuration-overview": "https://grafana.com/docs/pyroscope/latest/",
"docs/agent-install-linux": "https://grafana.com/docs/pyroscope/latest/",
"docs/agent-install-macos": "https://grafana.com/docs/pyroscope/latest/",
"docs/agent-install-windows": "https://grafana.com/docs/pyroscope/latest/",
"docs/agent-kubernetes": "https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/helm/",
"docs/agent-overview": "https://grafana.com/docs/pyroscope/latest/",
"docs/api-key-authentication": "https://grafana.com/docs/pyroscope/latest/",
"docs/architecture": "https://grafana.com/docs/pyroscope/latest/reference-pyroscope-architecture/",
"docs/auth-github": "https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/github/",
"docs/auth-gitlab": "https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/gitlab/",
"docs/auth-google": "https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/google/",
"docs/auth-internal": "https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/",
"docs/auth-overview": "https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-authentication/",
"docs/aws-lambda": "https://github.com/grafana/pyroscope-lambda-extension",
"docs/ci": "https://grafana.com/docs/pyroscope/latest/",
"docs/data-retention": "https://grafana.com/docs/pyroscope/latest/",
"docs/deployment": "https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/",
"docs/developer-guide": "https://grafana.com/docs/pyroscope/latest/reference-pyroscope-architecture/",
"docs/docker-compose": "https://grafana.com/docs/pyroscope/latest/",
"docs/docker-guide": "https://grafana.com/docs/pyroscope/latest/",
"docs/dotnet-old": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/dotnet/",
"docs/dotnet": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/dotnet/",
"docs/ebpf": "https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/ebpf/",
"docs/flamegraph-com": "https://grafana.com/docs/pyroscope/latest/",
"docs/flameql": "https://grafana.com/docs/pyroscope/latest/",
"docs/golang-old": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/go_push/",
"docs/golang-pull-mode": "https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/go_pull/",
"docs/golang-tracing": "https://grafana.com/docs/pyroscope/latest/",
"docs/golang": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/go_push/",
"docs/grafana-plugins": "https://grafana.com/docs/grafana/latest/datasources/grafana-pyroscope/",
"docs/how-pyroscope-works": "https://grafana.com/docs/pyroscope/latest/get-started/",
"docs/installing-pyroscope-overview": "https://grafana.com/docs/pyroscope/latest/get-started/",
"docs/java-tracing": "https://grafana.com/docs/pyroscope/latest/",
"docs/java": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/java/",
"docs/kubernetes-helm-chart": "https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/helm/",
"docs/metrics-export": "https://grafana.com/docs/pyroscope/latest/",
"docs/new-integrations": "https://grafana.com/docs/pyroscope/latest/",
"docs/nodejs": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/nodejs/",
"docs/php": "https://grafana.com/docs/pyroscope/latest/",
"docs/python": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/python/",
"docs/remote-write": "https://grafana.com/docs/pyroscope/latest/",
"docs/ruby-tracing": "https://grafana.com/docs/pyroscope/latest/",
"docs/ruby": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/ruby/",
"docs/rust": "https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/rust/",
"docs/server-api-reference": "https://grafana.com/docs/pyroscope/latest/",
"docs/server-configuration": "https://grafana.com/docs/pyroscope/latest/configure-server/",
"docs/server-install-linux": "https://grafana.com/docs/pyroscope/latest/",
"docs/server-install-macos": "https://grafana.com/docs/pyroscope/latest/",
"docs/server-kubernetes": "https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/",
"docs/server-overview": "https://grafana.com/docs/pyroscope/latest/",
"docs/storage-design": "https://grafana.com/docs/pyroscope/latest/",
"docs/style-guide": "https://grafana.com/docs/pyroscope/latest/",
"docs/supported-integrations": "https://grafana.com/docs/pyroscope/latest/configure-client/",
"downloads": "https://github.com/grafana/pyroscope/releases"
"docs/tags": "https://grafana.com/docs/pyroscope/latest/",
"docs/troubleshooting-faq": "https://grafana.com/docs/pyroscope/latest/",
"downloads": "https://github.com/grafana/pyroscope/releases",
"pricing": "https://grafana.com/auth/sign-up/create-user?src=pyroscope"
}

0 comments on commit 0d7d273

Please sign in to comment.