Skip to content

Commit

Permalink
Merge pull request #420 from stockholmux/version-box
Browse files Browse the repository at this point in the history
Add a current version box to documentation homepage.
  • Loading branch information
stockholmux authored Feb 13, 2024
2 parents 340327b + a77e334 commit 7a7c193
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions content/en/_index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ type="docs"
title="Documentation"
+++

{{< current-full-version >}}

You may be familiar with general purpose Linux distributions like Ubuntu, Fedora, or Amazon Linux.
With these Linux distributions, you can run a variety of workloads, setup in a variety of ways.
While Bottlerocket is also a Linux distribution, Bottlerocket stands in stark contrast to general purpose distributions by being specifically optimized to host containers and interoperate directly with container orchestrators such as Kubernetes or ECS.
Expand Down
2 changes: 2 additions & 0 deletions data/project_long_names.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
os = "Bottlerocket OS"
brupop = "Bottlerocket Update Operator"
3 changes: 3 additions & 0 deletions data/repos/os.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
github = "https://github.com/bottlerocket-os/bottlerocket"
path_prefix = "/tree/develop"
github_issue_url = "https://github.com/bottlerocket-os/bottlerocket/issues/new/choose"
8 changes: 8 additions & 0 deletions layouts/shortcodes/current-full-version.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{- $project_short := .Get "project" | default "os" -}}
{{- $repo_metadata := index $.Site.Data.repos $project_short -}}
{{- $full_version := print $.Site.Data.versions.current.os.major "." $.Site.Data.versions.current.os.minor "." $.Site.Data.versions.current.os.patch -}}
<div class="card border-success mb-3">
<div class="card-body">
The most recent release of {{ index $.Site.Data.project_long_names $project_short }} is <strong>{{ $full_version }}</strong> (<a href="{{ $repo_metadata.github }}/releases/tag/v{{ $full_version }}">Release Notes</a>).
</div>
</div>

0 comments on commit 7a7c193

Please sign in to comment.