diff --git a/api/github.go b/api/github.go index b9f4700..dc3a6c2 100644 --- a/api/github.go +++ b/api/github.go @@ -28,14 +28,14 @@ func Github(c echo.Context) error { newData = map[string]interface{}{ "tier": "OneTime", "name": getName(g.Sponsorship.Sponsor), - "url": g.Sponsorship.Sponsor.HtmlURL, + "url": g.Sponsorship.Sponsor.HTMLURL, "avatar": g.Sponsorship.Sponsor.AvatarURL, } case !g.Sponsorship.Tier.IsOneTime: newData = map[string]interface{}{ "tier": g.Sponsorship.Tier.Name, "name": getName(g.Sponsorship.Sponsor), - "url": g.Sponsorship.Sponsor.HtmlURL, + "url": g.Sponsorship.Sponsor.HTMLURL, "avatar": g.Sponsorship.Sponsor.AvatarURL, } } diff --git a/api/kofi.go b/api/kofi.go index c1117a0..c8c17ac 100644 --- a/api/kofi.go +++ b/api/kofi.go @@ -28,7 +28,7 @@ func Kofi(c echo.Context) error { newData = map[string]interface{}{ "tier": "OneTime", "name": k.FromName, - "url": k.Url, + "url": k.URL, "avatar": hashString(k.Email), } case "Subscription": @@ -36,7 +36,7 @@ func Kofi(c echo.Context) error { newData = map[string]interface{}{ "tier": k.TierName, "name": k.FromName, - "url": k.Url, + "url": k.URL, "avatar": hashString(k.Email), } } diff --git a/lib/codeparser.go b/lib/codeparser.go index 2a9af16..4f3a172 100644 --- a/lib/codeparser.go +++ b/lib/codeparser.go @@ -11,8 +11,8 @@ import ( ) type codeBlockContext struct { - language []byte attributes ImmutableAttributes + language []byte } func newCodeBlockContext(language []byte, attrs ImmutableAttributes) CodeBlockContext { @@ -120,7 +120,7 @@ type HTMLRenderer struct { } // NewHTMLRenderer builds a new HTMLRenderer with given options and returns it. -func NewHTMLRenderer(opts ...Option) renderer.NodeRenderer { +func NewHTMLRenderer() renderer.NodeRenderer { r := &HTMLRenderer{ Config: NewConfig(), } @@ -203,6 +203,6 @@ func NewCodewrap(opts ...Option) goldmark.Extender { // Extend implements goldmark.Extender. func (e *codewrap) Extend(m goldmark.Markdown) { m.Renderer().AddOptions(renderer.WithNodeRenderers( - util.Prioritized(NewHTMLRenderer(e.options...), 200), + util.Prioritized(NewHTMLRenderer(), 200), )) } diff --git a/lib/donos.go b/lib/donos.go index c8c03e5..8d5abcd 100644 --- a/lib/donos.go +++ b/lib/donos.go @@ -61,7 +61,7 @@ func AppendToDonos(newData map[string]interface{}) { defer file.Close() var existingData []map[string]interface{} - if err := json.NewDecoder(file).Decode(&existingData); err != nil && err.Error() != "EOF" { + if err = json.NewDecoder(file).Decode(&existingData); err != nil && err.Error() != "EOF" { log.Println("Error decoding JSON:", err) } existingData = append(existingData, newData) diff --git a/lib/feeds.go b/lib/feeds.go index 4efc58b..0519c37 100644 --- a/lib/feeds.go +++ b/lib/feeds.go @@ -20,7 +20,7 @@ func genFeed() *feeds.Feed { var feedItems []*feeds.Item for _, post := range posts { created, _ := time.Parse("02/01/2006", post.Date) - created.Format(time.RFC3339) + _ = created.Format(time.RFC3339) href := "https://isabelroses.com/blog/" + post.Slug feedItems = append(feedItems, &feeds.Item{ Id: href, diff --git a/lib/types.go b/lib/types.go index be1feaf..ac7ffc9 100644 --- a/lib/types.go +++ b/lib/types.go @@ -18,13 +18,13 @@ type Project struct { } type Post struct { - ID int Title string Description string Content template.HTML Date string - Tags []string Slug string + Tags []string + ID int } type Posts []Post @@ -38,23 +38,23 @@ type Subscriber struct { type Subscribers []Subscriber type KofiDono struct { - VerificationToken string `json:"verification_token"` - MessageId string `json:"message_id"` + Message string `json:"message"` + ShopItems string `json:"shop_items"` Timestamp string `json:"timestamp"` Type string `json:"type"` - IsPublic bool `json:"is_public"` + VerificationToken string `json:"verification_token"` FromName string `json:"from_name"` - Message string `json:"message"` + MessageID string `json:"message_id"` Amount string `json:"amount"` - Url string `json:"url"` - Email string `json:"email"` Currency string `json:"currency"` - IsSubscription bool `json:"is_subscription_payment"` - IsFirstSubscription bool `json:"is_first_subscription_payment"` - TransactionID string `json:"kofi_transaction_id"` - ShopItems string `json:"shop_items"` - TierName string `json:"tier_name"` + Email string `json:"email"` + URL string `json:"url"` Shipping string `json:"shipping"` + TierName string `json:"tier_name"` + TransactionID string `json:"kofi_transaction_id"` + IsPublic bool `json:"is_public"` + IsFirstSubscription bool `json:"is_first_subscription_payment"` + IsSubscription bool `json:"is_subscription_payment"` } type GitHubDono struct { @@ -76,14 +76,14 @@ type GitHubDono struct { type GitHubSponsor struct { AvatarURL string `json:"avatar_url"` Login string `json:"login"` - HtmlURL string `json:"html_url"` + HTMLURL string `json:"html_url"` Name string `json:"name"` } type Donor struct { Tier string Name string - Url string + URL string Avatar string } diff --git a/pages/blog.go b/pages/blog.go index e775668..fa3c2a7 100644 --- a/pages/blog.go +++ b/pages/blog.go @@ -7,9 +7,9 @@ import ( ) type BlogProps struct { + Tag string Posts lib.Posts Tags []string - Tag string } func Blog(c echo.Context) error { diff --git a/templates/components/usercard.tmpl b/templates/components/usercard.tmpl index 295ac1e..3c400ad 100644 --- a/templates/components/usercard.tmpl +++ b/templates/components/usercard.tmpl @@ -1,5 +1,5 @@ {{define "usercard"}} - + {{.Name}}'s icon {{.Name}} diff --git a/templates/pages/donos.tmpl b/templates/pages/donos.tmpl index 9924039..a7df820 100644 --- a/templates/pages/donos.tmpl +++ b/templates/pages/donos.tmpl @@ -1,6 +1,6 @@ -{{define "title"}}Donations{{end}} -{{define "description"}}A thanks to all those who support me{{end}} -{{define "additionalhead"}}{{end}} +{{define "title"}}Donations{{end}} +{{define "description"}}A thanks to all those who support me{{end}} +{{define "additionalhead"}}{{end}} {{define "main"}}
@@ -13,7 +13,7 @@ {{if .Subscribers | len}}

Subscribers

- {{range .Subscribers}} + {{range .Subscribers}} {{template "usercard" .}} {{end}}
@@ -24,7 +24,7 @@

One Time Donors

{{if .OneTimeDonors | len}} - {{range .OneTimeDonors}} + {{range .OneTimeDonors}} {{template "usercard" .}} {{end}} {{else}}