Skip to content

Commit ecd22ad

Browse files
committed
feat: enhance versions page with latest version highlighting and legend
1 parent 543803a commit ecd22ad

2 files changed

Lines changed: 62 additions & 8 deletions

File tree

.github/templates/versions.html

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343
.version-list li:hover {
4444
background: #ebeef1;
4545
}
46+
.version-list li.latest-version {
47+
background: #d4edda;
48+
border: 1px solid #28a745;
49+
}
50+
.version-list li.latest-version:hover {
51+
background: #c3e6cb;
52+
}
4653
.version-list a {
4754
color: #0366d6;
4855
text-decoration: none;
@@ -128,6 +135,38 @@
128135
.github-link svg {
129136
fill: white;
130137
}
138+
.legend {
139+
display: flex;
140+
flex-wrap: wrap;
141+
gap: 20px;
142+
justify-content: center;
143+
margin-top: 20px;
144+
padding: 15px;
145+
background: #f6f8fa;
146+
border-radius: 6px;
147+
}
148+
.legend-item {
149+
display: flex;
150+
align-items: center;
151+
gap: 8px;
152+
font-size: 14px;
153+
color: #586069;
154+
}
155+
.legend-color {
156+
width: 16px;
157+
height: 16px;
158+
border-radius: 4px;
159+
}
160+
.legend-color.latest {
161+
background: #d4edda;
162+
border: 1px solid #28a745;
163+
}
164+
.legend-color.snapshot {
165+
background: #ffc107;
166+
}
167+
.legend-color.archived {
168+
background: #6c757d;
169+
}
131170
</style>
132171
</head>
133172
<body>
@@ -155,6 +194,21 @@ <h2>Available Versions</h2>
155194
<!-- VERSION_LIST_PLACEHOLDER -->
156195
</ul>
157196

197+
<div class="legend">
198+
<div class="legend-item">
199+
<div class="legend-color latest"></div>
200+
<span>Latest stable release</span>
201+
</div>
202+
<div class="legend-item">
203+
<div class="legend-color snapshot"></div>
204+
<span>Development snapshot</span>
205+
</div>
206+
<div class="legend-item">
207+
<div class="legend-color archived"></div>
208+
<span>Previous versions</span>
209+
</div>
210+
</div>
211+
158212
<div class="footer">
159213
<p>
160214
<a href="https://github.com/copilot-community-sdk/copilot-sdk-java">GitHub Repository</a> ·

.github/workflows/deploy-site.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -190,25 +190,25 @@ jobs:
190190
# Get versions from git tags (already sorted by version, descending)
191191
VERSIONS=$(git -C .. tag -l | grep -E '^v?[0-9]+\.[0-9]+' | sed 's/^v//' | sort -Vr)
192192
HAS_SNAPSHOT=$([ -d "snapshot" ] && echo "true" || echo "false")
193-
HAS_LATEST=$([ -d "latest" ] && echo "true" || echo "false")
194193
195194
# Generate version links
196195
VERSION_HTML=""
197-
198-
# Add latest link if exists
199-
if [ "$HAS_LATEST" = "true" ]; then
200-
VERSION_HTML+='<li><a href="./latest/">Latest Release</a><span class="badge latest">latest</span></li>'
201-
fi
196+
IS_FIRST_VERSION="true"
202197
203198
# Add snapshot if exists
204199
if [ "$HAS_SNAPSHOT" = "true" ]; then
205200
VERSION_HTML+='<li><a href="./snapshot/">Development (main branch)</a><span class="badge snapshot">snapshot</span></li>'
206201
fi
207202
208-
# Add versioned releases from tags
203+
# Add versioned releases from tags (first one is latest)
209204
for v in $VERSIONS; do
210205
if [ -d "$v" ]; then
211-
VERSION_HTML+="<li><a href=\"./$v/\">Version $v</a><span class=\"badge archived\">$v</span></li>"
206+
if [ "$IS_FIRST_VERSION" = "true" ]; then
207+
VERSION_HTML+="<li class=\"latest-version\"><a href=\"./$v/\">Version $v</a><span class=\"badge latest\">latest</span></li>"
208+
IS_FIRST_VERSION="false"
209+
else
210+
VERSION_HTML+="<li><a href=\"./$v/\">Version $v</a><span class=\"badge archived\">$v</span></li>"
211+
fi
212212
fi
213213
done
214214

0 commit comments

Comments
 (0)