Commit 5b7c7ad

Anton Medvedev <anton@medv.io>
2025-12-01 20:49:18
Improve commit template styling and ensure date formatting consistency
- Adjusted CSS for better text wrapping and readability in commits. - Updated date formatting in `FormatDate` function with inline HTML for non-wrapping spans.
1 parent a37b278
Changed files (3)
pkg/templates/commit.gohtml
@@ -26,6 +26,8 @@
       .commit-author {
         color: var(--c-text-1);
         font-weight: 600;
+        min-width: 0;
+        overflow-wrap: break-word;
       }
 
       .commit-date {
@@ -58,12 +60,15 @@
       .commit-subject {
         font-size: 16px;
         font-weight: 600;
+        line-height: 1.3;
+        hyphens: auto;
       }
 
       .commit-body {
         margin-top: 16px;
         white-space: pre-wrap;
         line-height: 1.5;
+        hyphens: auto;
       }
 
       .commit-subinfo {
pkg/templates/layout.gohtml
@@ -88,6 +88,10 @@
           flex-direction: column;
         }
 
+        .nowrap {
+          white-space: nowrap;
+        }
+
         h1 {
           margin-inline: 0;
           margin-block: 16px;
pkg/templates/templates.go
@@ -12,8 +12,8 @@ import (
 
 var funcs = FuncMap{
 	"BaseName": filepath.Base,
-	"FormatDate": func(date time.Time) string {
-		return date.Format("2006-01-02 15:04:05")
+	"FormatDate": func(date time.Time) HTML {
+		return HTML(date.Format(`<span class="nowrap">2006-01-02</span> <span class="nowrap">15:04:05</span>`))
 	},
 	"ShortHash": func(hash string) string {
 		return hash[:7]