diff --git a/crates/boot/src/entries.rs b/crates/boot/src/entries.rs index 903669e..88ad5a1 100644 --- a/crates/boot/src/entries.rs +++ b/crates/boot/src/entries.rs @@ -74,6 +74,16 @@ impl BootableEntry { self.title = self.context.stamp(&self.title); } + /// Restamp the declared sort key with the current context. + /// A sort key that was set on this entry directly is left as is. + pub fn restamp_sort_key(&mut self) { + if self.sort_key.is_none() + && let Some(ref sort_key) = self.declaration.sort_key + { + self.sort_key = Some(self.context.stamp(sort_key)); + } + } + /// Mark this entry as the default entry. pub fn mark_default(&mut self) { self.default = true; diff --git a/crates/boot/src/main.rs b/crates/boot/src/main.rs index bfed7f3..730906a 100644 --- a/crates/boot/src/main.rs +++ b/crates/boot/src/main.rs @@ -271,8 +271,9 @@ fn run() -> Result<()> { .freeze(); // Provide the new context to the bootable entry. entry.swap_context(context); - // Restamp the title with any values. + // Restamp the title and sort key with any values. entry.restamp_title(); + entry.restamp_sort_key(); // Mark this entry as the default entry if it is declared as such. if let Some(ref default_entry) = config.options.default_entry {