From 71f0959b9e0b543ce9f08f8a11a236c72b6ceabc Mon Sep 17 00:00:00 2001 From: George Cushen Date: Tue, 7 May 2019 21:39:43 +0100 Subject: [PATCH] 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 --- layouts/authors/list.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/authors/list.html b/layouts/authors/list.html index 12a4a118..20343fbf 100644 --- a/layouts/authors/list.html +++ b/layouts/authors/list.html @@ -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}}