From 9c295ea072c3d8ef50d00df5f5aa67cfcc883915 Mon Sep 17 00:00:00 2001 From: Jack Baldry Date: Tue, 3 Oct 2023 09:14:06 +0100 Subject: [PATCH] Add front matter that informs Hugo that the Grafana content is versioned (#74259) This is necessary to allow version inference in CI builds. Shortcodes like `docs/reference` and `docs/shared` use version inference to avoid the writer having to hardcode specific versions or use relative paths within the documentation set. Signed-off-by: Jack Baldry --- .drone.yml | 6 +++++- scripts/drone/steps/lib.star | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 5028bb037c6..664e0ed7ed1 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1061,6 +1061,8 @@ steps: name: lint-docs - commands: - mkdir -p /hugo/content/docs/grafana/latest + - 'echo -e ''---\nredirectURL: /docs/grafana/latest/\ntype: redirect\nversioned: + true\n---\n'' > /hugo/content/docs/grafana/_index.md' - cp -r docs/sources/* /hugo/content/docs/grafana/latest/ - cd /hugo && make prod image: grafana/docs-base:dbd975af06 @@ -1347,6 +1349,8 @@ steps: name: lint-docs - commands: - mkdir -p /hugo/content/docs/grafana/latest + - 'echo -e ''---\nredirectURL: /docs/grafana/latest/\ntype: redirect\nversioned: + true\n---\n'' > /hugo/content/docs/grafana/_index.md' - cp -r docs/sources/* /hugo/content/docs/grafana/latest/ - cd /hugo && make prod image: grafana/docs-base:dbd975af06 @@ -4212,6 +4216,6 @@ kind: secret name: gcr_credentials --- kind: signature -hmac: c14ca5e053041018df6b66df642accd7e7eee7e2b43ba8c8f7dee6c446a41bb0 +hmac: 852af171d897f0a2cc0b03375fa8dfeacc65c2df7113c5efd0e21b03195dd7af ... diff --git a/scripts/drone/steps/lib.star b/scripts/drone/steps/lib.star index 80f15770d46..b2dbb5d6f49 100644 --- a/scripts/drone/steps/lib.star +++ b/scripts/drone/steps/lib.star @@ -788,6 +788,7 @@ def build_docs_website_step(): "image": images["docs"], "commands": [ "mkdir -p /hugo/content/docs/grafana/latest", + "echo -e '---\\nredirectURL: /docs/grafana/latest/\\ntype: redirect\\nversioned: true\\n---\\n' > /hugo/content/docs/grafana/_index.md", "cp -r docs/sources/* /hugo/content/docs/grafana/latest/", "cd /hugo && make prod", ],