summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-10-21 11:26:57 +0800
committerEltrac <hi@guhub.cn>2025-10-21 11:26:57 +0800
commite09fd5cf7551c8016fc46cf73cc801ed287da6f0 (patch)
treea7f6961846264b23c274ae4b864c436d76e7b802 /scripts
parent5d28108680cd43f616cd8301cf8a065c419ab7bd (diff)
fix(build): function parameter overwrites certain object
Former-commit-id: dbea3c444c17032aa8524c337976610ee0a81fa2
Diffstat (limited to 'scripts')
-rw-r--r--scripts/extract_links.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/extract_links.go b/scripts/extract_links.go
index 2b7b243a..657cb738 100644
--- a/scripts/extract_links.go
+++ b/scripts/extract_links.go
@@ -112,10 +112,10 @@ func parseFrontmatter(filepath string) (Frontmatter, int) {
return fm, lineNum
}
-func getCanonicalURL(filepath string, fm Frontmatter) string {
- rel, _ := filepathRel(contentDir, filepath)
+func getCanonicalURL(path string, fm Frontmatter) string {
+ rel, _ := filepathRel(contentDir, path)
dir := filepath.Dir(rel)
- base := strings.TrimSuffix(filepath.Base(filepath), ".md")
+ base := strings.TrimSuffix(filepath.Base(path), ".md")
slug := fm.Slug
if slug == "" {
slug = strings.ToLower(base)