diff options
author | Alex <a.scerba02@gmail.com> | 2023-12-31 01:17:20 -0500 |
---|---|---|
committer | Alex Scerba <alex@scerba.org> | 2024-10-29 13:19:59 -0400 |
commit | 10f0dacded56edddd3cdd4177f7de608f812c372 (patch) | |
tree | 6c062079a172fac3711bc9223387db8412835322 | |
parent | 6a45f5194412477931c1bd703a98b3342ef05851 (diff) |
Update load function to search template tags for date instead of HTML tags
-rw-r--r-- | load.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -88,7 +88,7 @@ func (app *application) readFile(location string) (p *Post, err error) { title := strings.ReplaceAll(fileName, "_", " ") // date - datePattern := regexp.MustCompile(`<time datetime="(\d{4}-\d{2}-\d{2})">`) + datePattern := regexp.MustCompile(`{{define "uploaded-on"}}(\d{4}-\d{2}-\d{2}){{end}}`) dateMatching := datePattern.FindStringSubmatch(string(fileContent)) var date string |