|
| 1 | +{{/* (C) 2023 GoodData Corporation */}} |
| 2 | +{{/* Static versions archive table - generated by Hugo at build time */}} |
| 3 | + |
| 4 | +{{ if .Site.Params.versions }} |
| 5 | + |
| 6 | +{{ $allVersions := .Site.Params.versions }} |
| 7 | +{{ $changelogPageURL := "https://github.com/gooddata/gooddata-python-sdk/releases/tag/v" }} |
| 8 | + |
| 9 | +{{ if $allVersions }} |
| 10 | +<div id="versions-container"> |
| 11 | + <!-- Non-dev versions table --> |
| 12 | + <div class="table-responsive"> |
| 13 | + <p>Latest versions</p> |
| 14 | + <table class="table table-striped table-hover" id="versions-table"> |
| 15 | + <thead class="table-dark"> |
| 16 | + <tr> |
| 17 | + <th scope="col">Version</th> |
| 18 | + <th scope="col">Documentation</th> |
| 19 | + <th scope="col">Changelog</th> |
| 20 | + </tr> |
| 21 | + </thead> |
| 22 | + <tbody id="versions-tbody"> |
| 23 | + {{ range $allVersions }} |
| 24 | + {{ if not (eq .version "dev") }} |
| 25 | + <tr> |
| 26 | + <td><strong>{{ .version }}</strong></td> |
| 27 | + <td> |
| 28 | + <a href="{{ .url }}" aria-label="View documentation for version {{ .version }}"> |
| 29 | + <i class="fas fa-book me-1" aria-hidden="true"></i>View Documentation |
| 30 | + </a> |
| 31 | + </td> |
| 32 | + <td> |
| 33 | + {{ if .changelog}} |
| 34 | + <a href="{{ .changelog }}" aria-label="View changelog for version {{ .version }}"> |
| 35 | + <i class="fas fa-book me-1" aria-hidden="true"></i>View Changelog |
| 36 | + </a> |
| 37 | + {{ else }} |
| 38 | + {{ $versionParts := split .version "." }} |
| 39 | + {{ $formattedVersion := .version }} |
| 40 | + {{ if eq (len $versionParts) 2 }} |
| 41 | + {{ $formattedVersion = printf "%s.0" .version }} |
| 42 | + {{ end }} |
| 43 | + <a href="{{ $changelogPageURL }}{{ $formattedVersion }}" aria-label="View changelog for version {{ .version }}"> |
| 44 | + <i class="fas fa-book me-1" aria-hidden="true"></i>View Changelog |
| 45 | + </a> |
| 46 | + {{ end }} |
| 47 | + </td> |
| 48 | + </tr> |
| 49 | + {{ end }} |
| 50 | + {{ end }} |
| 51 | + </tbody> |
| 52 | + </table> |
| 53 | + </div> |
| 54 | + <!-- Dev version table --> |
| 55 | + <div class="table-responsive"> |
| 56 | + <p>Versions in active development</p> |
| 57 | + <table class="table table-striped table-hover" id="dev-versions-table"> |
| 58 | + <thead class="table-dark"> |
| 59 | + <tr> |
| 60 | + <th scope="col">Version</th> |
| 61 | + <th scope="col">Documentation</th> |
| 62 | + </tr> |
| 63 | + </thead> |
| 64 | + <tbody id="dev-versions-tbody"> |
| 65 | + {{ range $allVersions }} |
| 66 | + {{ if eq .version "dev" }} |
| 67 | + <tr> |
| 68 | + <td><strong>{{ .version }}</strong></td> |
| 69 | + <td> |
| 70 | + <a href="{{ .url }}" aria-label="View documentation for version {{ .version }}"> |
| 71 | + <i class="fas fa-book me-1" aria-hidden="true"></i>View Documentation |
| 72 | + </a> |
| 73 | + </td> |
| 74 | + </tr> |
| 75 | + {{ end }} |
| 76 | + {{ end }} |
| 77 | + </tbody> |
| 78 | + </table> |
| 79 | + </div> |
| 80 | +</div> |
| 81 | +{{ else }} |
| 82 | +<div class="alert alert-warning" role="alert"> |
| 83 | + <h4>No Versions Available</h4> |
| 84 | + <p>No documentation versions are currently available for display.</p> |
| 85 | +</div> |
| 86 | +{{ end }} |
| 87 | +{{ end }} |
0 commit comments