fix: build fails on Windows: "Error: Could not find author page at..."

Caused due to Windows backslashes in path when extracting username from
folder name.

Fix #1068
This commit is contained in:
George Cushen committed 2019-05-07 21:39:43 +01:00
1 parent 8857bffa20
commit 71f0959b9e
1 file changed
+2 -2
+2 -2
View File
@@ -15,8 +15,8 @@
{{/* Show the About widget if an account exists for this user. */}}
{{ if .File }}
{{ $widget := "widgets/about.html" }}
{{ $slug := delimit (last 1 (split (trim .File.Dir "/") "/")) "" }}{{/* Alternatively, use `index .Params.authors 0` */}}
{{ $params := dict "root" $ "page" . "author" $slug }}
{{ $username := (path.Base (path.Split .Path).Dir) }}{{/* Alternatively, use `index .Params.authors 0` */}}
{{ $params := dict "root" $ "page" . "author" $username }}
{{ partial $widget $params }}
{{end}}