aboutsummaryrefslogtreecommitdiff
path: root/cmd/http
diff options
context:
space:
mode:
authorAlex Scerba <alex@scerba.org>2024-10-21 18:17:48 -0400
committerAlex Scerba <alex@scerba.org>2024-10-29 14:15:43 -0400
commit3d5538069c3b2f43ddf170d641feb926175db529 (patch)
treeb44a4dd92ce6552167707def8f1d802d548e804e /cmd/http
parentf12ecdaef5b5d13b33d291a20cc2b992d1528473 (diff)
Udpate to latest portfolio version
Diffstat (limited to 'cmd/http')
-rw-r--r--cmd/http/load.go4
1 files changed, 2 insertions, 2 deletions
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(`<img src="(.+)" class="mainImage"( alt="(.+)")* />`)
+ imagePattern := regexp.MustCompile(`{{define "thumbnail"}}<img src="(.+)" class="mainImage"( alt="(.+)")* />{{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 = ""
}