docs: Improve Git page (#26566)

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
This commit is contained in:
Nate Butler 2025-03-25 08:22:01 -04:00 committed by GitHub
parent d40f8889b9
commit f1a9fdddab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 97 additions and 41 deletions

View file

@ -31,6 +31,11 @@ impl Template for KeybindingTemplate {
let action = args.get("action").map(String::as_str).unwrap_or("");
let macos_binding = context.find_binding("macos", action).unwrap_or_default();
let linux_binding = context.find_binding("linux", action).unwrap_or_default();
if macos_binding.is_empty() && linux_binding.is_empty() {
return "<div>No default binding</div>".to_string();
}
format!("<kbd class=\"keybinding\">{macos_binding}|{linux_binding}</kbd>")
}
}