Skip to content

Commit c6f07de

Browse files
committed
fix: use branch instead of tag
Signed-off-by: Mateusz Urbanek <mateusz.urbanek.98@gmail.com>
1 parent 3694bfc commit c6f07de

File tree

8 files changed

+16
-2340
lines changed

8 files changed

+16
-2340
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ build-docs: generate mdbook
119119
MDBOOK_PORT ?= 3000
120120

121121
.PHONY: serve-docs
122-
serve-docs: generate mdbook
122+
serve-docs: generate mdbook build-docs
123123
cd docs; $(MDBOOK) serve --port $(MDBOOK_PORT)
124124

125125
.PHONY: clean
@@ -175,7 +175,7 @@ CTLPTL_VERSION ?= v0.8.39
175175
GOLANGCI_LINT_VERSION ?= v1.64.7
176176
KIND_VERSION ?= v0.27.0
177177
KUSTOMIZE_VERSION ?= v5.6.0
178-
MDBOOK_VERSION ?= v0.4.47
178+
MDBOOK_VERSION ?= v0.4.45
179179

180180
.PHONY: chainsaw
181181
chainsaw: $(CHAINSAW)-$(CHAINSAW_VERSION)

docs/book.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ authors = ["The Kubernetes Authors"]
66
[output.html]
77
git-repository-url = "https://github.com/kubernetes-sigs/container-object-storage-interface/tree/main/docs"
88
edit-url-template = "https://github.com/kubernetes-sigs/container-object-storage-interface/tree/main/docs/{path}"
9-
additional-css = ["custom.css"]
9+
additional-css = ["theme/custom.css"]
10+
theme = "theme"
1011

1112
[preprocessor.generate-version]
1213
renderers = ["html"]

docs/scripts/generate-version.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1-
jq ".[1]";
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
jq ".[1]"
6+
27
SHA=$(git rev-parse HEAD)
3-
VERSION="Built from: <a target="_blank" href=\"https:\/\/github.com\/kubernetes-sigs\/container-object-storage-interface\/tree\/${SHA}\"><code>${SHA}<\/code><\/a>"
4-
TAG=$(git tag --contains "$SHA" | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$')
5-
if [ -n "$TAG" ]; then
6-
VERSION="Version: <a target="_blank" href=\"https:\/\/github.com\/kubernetes-sigs\/container-object-storage-interface\/tree\/${TAG}\"><code>${TAG}<\/code><\/a> ${VERSION}"
8+
VERSION="Commit: <a target="_blank" href=\"https:\/\/github.com\/kubernetes-sigs\/container-object-storage-interface\/tree\/${SHA}\"><code>${SHA}<\/code><\/a>"
9+
BRANCH=$(git rev-parse --abbrev-ref HEAD)
10+
11+
if [ -n "$BRANCH" ]; then
12+
VERSION="Branch: <a target="_blank" href=\"https:\/\/github.com\/kubernetes-sigs\/container-object-storage-interface\/tree\/${BRANCH}\"><code>${BRANCH}<\/code><\/a> ${VERSION}"
713
fi
14+
815
sed "s/VERSION-PLACEHOLDER/${VERSION}/" theme/index-template.hbs > theme/index.hbs
File renamed without changes.

0 commit comments

Comments
 (0)