Skip to content

Commit

Permalink
support Throne icons, bump versions
Browse files Browse the repository at this point in the history
  • Loading branch information
bcmk committed Nov 24, 2024
1 parent 98c043b commit e4633a2
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 20 deletions.
4 changes: 4 additions & 0 deletions cmd/site/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Main site executable
package main

import (
Expand Down Expand Up @@ -28,6 +29,8 @@ import (
"github.com/tdewolff/minify/v2"
hmin "github.com/tdewolff/minify/v2/html"

_ "image/png"

_ "github.com/mattn/go-sqlite3"
)

Expand Down Expand Up @@ -127,6 +130,7 @@ var packParams = []string{
"fancentro",
"frisk",
"fansly",
"throne",
"avn",
"mail",
"snapchat",
Expand Down
1 change: 1 addition & 0 deletions cmd/site/pages/common/icons-code-generator.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
{{- template "simple_icon" enhance $base_map (map "name" "manyvids" "value" .params.manyvids) -}}
{{- template "simple_icon" enhance $base_map (map "name" "frisk" "value" .params.frisk) -}}
{{- template "simple_icon" enhance $base_map (map "name" "fansly" "value" .params.fansly) -}}
{{- template "simple_icon" enhance $base_map (map "name" "throne" "value" .params.throne) -}}
{{- template "simple_icon" enhance $base_map (map "name" "avn" "value" .params.avn) -}}
{{- template "simple_icon" enhance $base_map (map "name" "mail" "value" .params.mail) -}}
{{- template "simple_icon" enhance $base_map (map "name" "snapchat" "value" .params.snapchat) -}}
Expand Down
3 changes: 3 additions & 0 deletions cmd/site/pages/en/pack.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@
{{ if $pack.VisibleIcons.fansly }}
{{ template "simple_input" map "ctx" . "name" "fansly" "comment" "Fansly link" }}
{{ end }}
{{ if $pack.VisibleIcons.throne }}
{{ template "simple_input" map "ctx" . "name" "throne" "comment" "Throne link" }}
{{ end }}
{{ if $pack.VisibleIcons.avn }}
{{ template "simple_input" map "ctx" . "name" "avn" "comment" "AVN Stars link" }}
{{ end }}
Expand Down
3 changes: 3 additions & 0 deletions cmd/site/pages/ru/pack.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@
{{ if $pack.VisibleIcons.fansly }}
{{ template "simple_input" map "ctx" . "name" "fansly" "comment" "Ссылка на Fansly" }}
{{ end }}
{{ if $pack.VisibleIcons.throne }}
{{ template "simple_input" map "ctx" . "name" "throne" "comment" "Ссылка на Throne" }}
{{ end }}
{{ if $pack.VisibleIcons.avn }}
{{ template "simple_input" map "ctx" . "name" "avn" "comment" "Ссылка на AVN Stars" }}
{{ end }}
Expand Down
21 changes: 16 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@ require (
github.com/bcmk/telegram-bot-api v1.0.1-0.20200926205526-fa6e30cde1b9
github.com/chromedp/cdproto v0.0.0-20211002082225-0242b9dca9f4
github.com/chromedp/chromedp v0.7.4
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
github.com/mattn/go-sqlite3 v1.14.8
github.com/mattn/go-sqlite3 v1.14.24
github.com/nicklaw5/helix v1.25.0
github.com/tdewolff/minify/v2 v2.9.21
golang.org/x/image v0.12.0
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/chromedp/sysutil v1.0.0 // indirect
github.com/felixge/httpsnoop v1.0.1 // indirect
github.com/gobwas/httphead v0.1.0 // indirect
github.com/gobwas/pool v0.2.1 // indirect
github.com/gobwas/ws v1.1.0 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/tdewolff/parse/v2 v2.5.19 // indirect
github.com/technoweenie/multipartstreamer v1.0.1 // indirect
golang.org/x/sys v0.5.0 // indirect
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
)

go 1.13
go 1.23
10 changes: 4 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFF
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2/go.mod h1:0KeJpeMD6o+O4hW7qJOT7vyQPKrWmj26uf5wMc/IiIs=
github.com/mattn/go-sqlite3 v1.14.8 h1:gDp86IdQsN/xWjIEmr9MF6o9mpksUgh0fu+9ByFxzIU=
github.com/mattn/go-sqlite3 v1.14.8/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/mattn/go-sqlite3 v1.14.24 h1:tpSp2G2KyMnnQu99ngJ47EIkWVmliIizyZBfPrBWDRM=
github.com/mattn/go-sqlite3 v1.14.24/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
github.com/nicklaw5/helix v1.25.0 h1:Mrz537izZVsGdM3I46uGAAlslj61frgkhS/9xQqyT/M=
github.com/nicklaw5/helix v1.25.0/go.mod h1:yvXZFapT6afIoxnAvlWiJiUMsYnoHl7tNs+t0bloAMw=
github.com/orisano/pixelmatch v0.0.0-20210112091706-4fa4c7ba91d5 h1:1SoBaSPudixRecmlHXb/GxmaD3fLMtHIDN13QujwQuc=
Expand Down Expand Up @@ -87,7 +87,5 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 1 addition & 1 deletion sitelib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"path/filepath"

"github.com/bcmk/siren/lib"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

// Icon represents all required icon's fields
Expand Down
9 changes: 1 addition & 8 deletions sitelib/packs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ package sitelib
import (
"encoding/json"
"encoding/xml"
"errors"
"image"
_ "image/png"
"os"
"path"
"regexp"
Expand Down Expand Up @@ -34,6 +32,7 @@ var IconNames = []string{
"fancentro",
"frisk",
"fansly",
"throne",
"mail",
"snapchat",
"telegram",
Expand Down Expand Up @@ -93,9 +92,6 @@ func ParsePacks(dir string) []Pack {
continue
}
if strings.HasSuffix(iconFileName, ".svg") {
if parsed.FinalType != "svg" {
lib.CheckErr(errors.New("incompatible icon type"))
}
width, height := parseSVGSize(path.Join(packDir, iconFileName))
foundIcons[notVersionedIconName] = Icon{
Name: versionedIconName,
Expand All @@ -104,9 +100,6 @@ func ParsePacks(dir string) []Pack {
}
}
if strings.HasSuffix(iconFileName, ".png") {
if parsed.FinalType != "png" {
lib.CheckErr(errors.New("incompatible icon type"))
}
width, height := parsePNGSize(path.Join(packDir, iconFileName))
foundIcons[notVersionedIconName] = Icon{
Name: versionedIconName,
Expand Down

0 comments on commit e4633a2

Please sign in to comment.