Skip to content

Commit

Permalink
docs: show archived/pre-release banner based on version
Browse files Browse the repository at this point in the history
Also clean up some stuff we're not going to use.

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira committed Mar 24, 2022
1 parent e403470 commit 7a88a02
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 50 deletions.
11 changes: 1 addition & 10 deletions website/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
*.log
.cache
.DS_Store
src/.temp
node_modules
dist
public
!.env.example
.env
.env.*
resources
3 changes: 0 additions & 3 deletions website/Dockerfile

This file was deleted.

1 change: 1 addition & 0 deletions website/content/v1.0/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ no_list: true
linkTitle: "Documentation"
cascade:
type: docs
preRelease: true
---

## Welcome
Expand Down
17 changes: 0 additions & 17 deletions website/deploy.sh

This file was deleted.

13 changes: 0 additions & 13 deletions website/docker-compose.yaml

This file was deleted.

25 changes: 18 additions & 7 deletions website/themes/docsy/layouts/partials/version-banner.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
<!-- Check the variable that indicates whether this is an archived doc set.
If yes, display a banner. -->
{{ if .Site.Params.archived_version }}
{{ $latest_version := .Site.Params.url_latest_version }}
{{ $current_version := .Section | printf "/%s" }}

{{ if .FirstSection.Params.prerelease }}
{{ $color := "primary" }}
{{ $latest_version := .Site.Params.url_latest_version }}
{{ $current_version := .Site.Params.version }}
<div class="pageinfo pageinfo-{{ $color }}">
{{ with $current_version }}<p>Version {{ . | markdownify }} of the
{{ with $current_version }}<p>Version {{ trim . "/" | markdownify }} of the
documentation is for the Talos version being developed.
{{ with $latest_version }}For the latest stable version of Talos, see the
<a href="{{ $latest_version | safeURL }}">latest version</a>.</p>
{{ end }}
{{ end }}
</div>
{{ else if ne $latest_version $current_version }}
{{ $color := "primary" }}
<div class="pageinfo pageinfo-{{ $color }}">
{{ with $current_version }}<p>Version {{ trim . "/" | markdownify }} of the
documentation is no longer actively maintained. The site that you are
currently viewing is an archived snapshot.
{{ with $latest_version }}For up-to-date documentation, see the
<a href="{{ $latest_version | safeURL }}" target="_blank">latest version</a>.</p>
currently viewing is an archived snapshot.
{{ with $latest_version }}For up-to-date documentation, see the
<a href="{{ $latest_version | safeURL }}">latest version</a>.</p>
{{ end }}
{{ end }}
</div>
Expand Down

0 comments on commit 7a88a02

Please sign in to comment.