From 0d7d273df612c44a850a44d6ff97d809d66955da Mon Sep 17 00:00:00 2001 From: Dmitry Filimonov Date: Mon, 2 Oct 2023 13:43:25 -0700 Subject: [PATCH] chore: more redirects to grafana.com (#182) * more redirects * improvement --- create-redirects.rb | 8 ++++-- redirects.json | 69 +++++++++++++++++++++++---------------------- 2 files changed, 42 insertions(+), 35 deletions(-) diff --git a/create-redirects.rb b/create-redirects.rb index ce593074..034d3b3c 100644 --- a/create-redirects.rb +++ b/create-redirects.rb @@ -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 diff --git a/redirects.json b/redirects.json index 7d332a4f..141c28de 100644 --- a/redirects.json +++ b/redirects.json @@ -1,37 +1,18 @@ { - "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/", @@ -39,25 +20,47 @@ "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" }