mirror of
https://codeberg.org/scip/kleingebaeck.git
synced 2025-12-16 12:01:00 +01:00
Generic attributes (#120)
* fix #117: use a generic attribute parser, still support fixed attrs
This commit is contained in:
38
example.conf
38
example.conf
@@ -15,17 +15,31 @@ loglevel = "verbose"
|
||||
# create it. must be a quoted string.
|
||||
outdir = "test"
|
||||
|
||||
# template for stored adlistings. To enable it, remove the comment
|
||||
# chars up until the last #"""
|
||||
#template="""
|
||||
#Title: {{.Title}}
|
||||
#Price: {{.Price}}
|
||||
#Id: {{.Id}}
|
||||
#Category: {{.Category}}
|
||||
#Condition: {{.Condition}}
|
||||
#Type: {{.Type}}
|
||||
#Created: {{.Created}}
|
||||
# template for stored adlistings.
|
||||
template="""
|
||||
Title: {{.Title}}
|
||||
Price: {{.Price}}
|
||||
Id: {{.Id}}
|
||||
Category: {{.Category}}
|
||||
Condition: {{.Condition}}
|
||||
Type: {{.Type}}
|
||||
Created: {{.Created}}
|
||||
|
||||
#{{.Text}}
|
||||
# """
|
||||
{{.Text}}
|
||||
"""
|
||||
|
||||
# Ads may contain more attributes than just the Condition. To print
|
||||
# all attributes, loop over all of them:
|
||||
|
||||
template="""
|
||||
Title: {{.Title}}
|
||||
Price: {{.Price}}
|
||||
Id: {{.Id}}
|
||||
Category: {{.Category}}
|
||||
{{ range $key,$val := .Attributes }}{{ $key }}: {{ $val }}
|
||||
{{ end }}
|
||||
Type: {{.Type}}
|
||||
Created: {{.Created}}
|
||||
|
||||
{{.Text}}
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user