aboutsummaryrefslogtreecommitdiff
path: root/template_funcs.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-10 20:53:27 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-10 20:53:27 +0800
commita3a9719af3d648c90b049e94d7d446651d0d011b (patch)
treea677752602b80b8dac97d1955ed32c7a506f033d /template_funcs.go
parentstyle.css: Separate darker and lighter border colors (diff)
downloadforge-a3a9719af3d648c90b049e94d7d446651d0d011b.tar.gz
forge-a3a9719af3d648c90b049e94d7d446651d0d011b.tar.zst
forge-a3a9719af3d648c90b049e94d7d446651d0d011b.zip
repo_tree: Fix URL and anchor issues
Diffstat (limited to 'template_funcs.go')
-rw-r--r--template_funcs.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/template_funcs.go b/template_funcs.go
index 3c5ca0b..1c68650 100644
--- a/template_funcs.go
+++ b/template_funcs.go
@@ -1,8 +1,15 @@
package main
-import "strings"
+import (
+ "path/filepath"
+ "strings"
+)
func first_line(s string) string {
before, _, _ := strings.Cut(s, "\n")
return before
}
+
+func base_name (s string) string {
+ return filepath.Base(s)
+}