parabellum: fix year extraction

This commit is contained in:
Garfield69
2025-05-07 07:10:00 +12:00
parent 19b528cbd7
commit 4c0f76dbde

View File

@@ -61,7 +61,7 @@ search:
order: "{{ .Config.sort }}"
search: "{{ .Keywords }}"
# if the year is not available in .Query.Year then extract it from .Query.Keywords if found
year: "{{ if .Query.Year }}{{ .Query.Year }}{{ else }}{{ re_replace .Query.Keywords \"\\b(.*([1|2][9|0]\\d{2}).*)\\b\" \"$2\" }}{{ end }}"
year: "{{ if .Query.Year }}{{ .Query.Year }}{{ else }}{{ re_replace .Query.Keywords \"(.*\\b([1|2][9|0]\\d{2})\\b.*)\" \"$2\" }}{{ end }}"
keywordsfilters:
- name: re_replace # remove year
args: ["\\b(20\\d{2})\\b", ""]