mirror of
https://github.com/rystaf/mlmym.git
synced 2024-11-22 05:36:16 +00:00
more thumbnails
This commit is contained in:
parent
e46820ed3f
commit
0a4888906a
|
@ -36,7 +36,7 @@ summary {
|
|||
transform: scale(1.03);
|
||||
}
|
||||
.post {
|
||||
margin: 6px;
|
||||
margin: 6px 0px;
|
||||
}
|
||||
.post .thumb {
|
||||
height: 52px;
|
||||
|
@ -55,10 +55,10 @@ summary {
|
|||
}
|
||||
.rank {
|
||||
color: #c6c6c6;
|
||||
font-size: medium;
|
||||
font-size: 14px;
|
||||
margin-top: 17px;
|
||||
text-align: right;
|
||||
min-width: 19px;
|
||||
min-width: 32px;
|
||||
}
|
||||
.dark .post .rank {
|
||||
color: #646464;
|
||||
|
|
|
@ -115,10 +115,15 @@ var funcMap = template.FuncMap{
|
|||
if p.ThumbnailURL.IsValid() {
|
||||
return p.ThumbnailURL.String() + "?format=jpg&thumbnail=96"
|
||||
}
|
||||
re := regexp.MustCompile(`^https:\/\/i.imgur.com\/([a-zA-Z0-9]+)\.([a-z]+)$`)
|
||||
re := regexp.MustCompile(`\/pictrs\/image\/([a-z0-9\-]+)\.([a-z]+)$`)
|
||||
if re.MatchString(p.URL.String()) {
|
||||
return p.URL.String() + "?format=jpg&thumbnail=96"
|
||||
}
|
||||
re = regexp.MustCompile(`^https:\/\/i.imgur.com\/([a-zA-Z0-9]+)\.([a-z]+)$`)
|
||||
if re.MatchString(p.URL.String()) {
|
||||
return re.ReplaceAllString(p.URL.String(), "https://i.imgur.com/${1}s.$2")
|
||||
} else if p.URL.IsValid() {
|
||||
}
|
||||
if p.URL.IsValid() {
|
||||
return "/_/static/link.png"
|
||||
}
|
||||
return "/_/static/text.png"
|
||||
|
|
Loading…
Reference in a new issue