From 3d5538069c3b2f43ddf170d641feb926175db529 Mon Sep 17 00:00:00 2001 From: Alex Scerba Date: Mon, 21 Oct 2024 18:17:48 -0400 Subject: Udpate to latest portfolio version --- cmd/http/load.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmd/http/load.go') diff --git a/cmd/http/load.go b/cmd/http/load.go index d63d7ce..b38fd26 100644 --- a/cmd/http/load.go +++ b/cmd/http/load.go @@ -85,12 +85,12 @@ func (app *application) readFile(location string) (p *Post, err error) { } // thumbnail image - imagePattern := regexp.MustCompile(`(.+)`) + imagePattern := regexp.MustCompile(`{{define "thumbnail"}}(.+){{end}}`) matchingImage := imagePattern.FindStringSubmatch(string(fileContent)) var image string if len(matchingImage) > 1 { - image = matchingImage[0] + image = strings.Trim(matchingImage[0], "{{define \"thumbnail\"}}") } else { image = "" } -- cgit v1.2.3