diff --git a/main.tpl b/main.tpl index 6567222..f5a2a59 100644 --- a/main.tpl +++ b/main.tpl @@ -67,19 +67,22 @@ ({{ . }}) {{ end }} {{ else }} - {{ if index . "Description" }} - {{ excerpt 384 (index . "Description") }} - {{ else }} - {{ with index . "ImageType" }} - {{ . }} image, + {{ with index . "Description" }} + {{ excerpt 384 . }} + {{ end }} + {{ end }} + + {{ if index . "ImageType" }} + {{ if index . "Title" }} + · + {{ end }} + {{ .ImageType }} image, + {{ if (index . "ImageSize") (index . "Size") }} + {{ with index . "ImageSize" }} + {{ .X }}×{{ .Y }} {{ end }} - {{ if (index . "ImageSize") (index . "Size") }} - {{ with index . "ImageSize" }} - {{ .X }}×{{ .Y }} - {{ end }} - {{ with index . "Size" }} - ({{ size . }}) - {{ end }} + {{ with index . "Size" }} + ({{ size . }}) {{ end }} {{ end }} {{ end }} diff --git a/parsers/web/parser.go b/parsers/web/parser.go index ea8808b..71fa357 100644 --- a/parsers/web/parser.go +++ b/parsers/web/parser.go @@ -133,6 +133,7 @@ func (p *Parser) Parse(u *url.URL, referer *url.URL) (result parsers.ParseResult "IsUpload": true, "ImageSize": image.Point{X: m.Width, Y: m.Height}, "ImageType": strings.ToUpper(imgType), + "Title": u.Path[strings.LastIndex(u.Path, "/")+1:], } if resp.ContentLength > 0 { info["Size"] = uint64(resp.ContentLength)