diff options
Diffstat (limited to 'cmd/http/load.go')
-rw-r--r-- | cmd/http/load.go | 4 |
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 = "" } |