Skip to content

Commit 0629d03

Browse files
committed
Display version dynamically in UI sidebar
- Add VERSION constant using CARGO_PKG_VERSION - Show version in both light and dark theme sidebars - Update workspace version to 0.2.7
1 parent 7512924 commit 0629d03

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ members = [
77
]
88

99
[workspace.package]
10-
version = "0.1.0"
10+
version = "0.2.7"
1111
edition = "2021"
1212
license = "MIT"
1313
authors = ["DevITWay <devitway@gmail.com>"]

nora-registry/src/ui/components.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/// Application version from Cargo.toml
2+
const VERSION: &str = env!("CARGO_PKG_VERSION");
3+
14
/// Main layout wrapper with header and sidebar
25
pub fn layout(title: &str, content: &str, active_page: Option<&str>) -> String {
36
format!(
@@ -202,13 +205,14 @@ fn sidebar_dark(active_page: Option<&str>) -> String {
202205
</nav>
203206
<div class="px-4 py-4 border-t border-slate-700">
204207
<div class="text-xs text-slate-400">
205-
Nora v0.2.0
208+
Nora v{}
206209
</div>
207210
</div>
208211
</div>
209212
"#,
210213
super::logo::LOGO_BASE64,
211-
nav_html
214+
nav_html,
215+
VERSION
212216
)
213217
}
214218

@@ -563,13 +567,14 @@ fn sidebar(active_page: Option<&str>) -> String {
563567
<!-- Footer -->
564568
<div class="px-4 py-4 border-t border-slate-700">
565569
<div class="text-xs text-slate-400">
566-
Nora v0.2.0
570+
Nora v{}
567571
</div>
568572
</div>
569573
</div>
570574
"#,
571575
super::logo::LOGO_BASE64,
572-
nav_html
576+
nav_html,
577+
VERSION
573578
)
574579
}
575580

0 commit comments

Comments
 (0)