From a3a9719af3d648c90b049e94d7d446651d0d011b Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 10 Feb 2025 20:53:27 +0800 Subject: repo_tree: Fix URL and anchor issues --- template_funcs.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'template_funcs.go') 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) +} -- cgit v1.2.3