Skip to content

Commit

Permalink
Improved meta tag containers allocation
Browse files Browse the repository at this point in the history
Signed-off-by: Sandy <sandy@sandyuraz.com>
  • Loading branch information
thecsw committed Jul 2, 2022
1 parent 9a26e41 commit 942ac48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions html/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func addBasic(page *internals.Page, description string) string {
{"theme-color", "theme-color", emilia.Config.Website.Color},
{"description", "description", html.EscapeString(description)},
}
basicTags := make([]string, 5)
basicTags := make([]string, len(toAdd))
for i, add := range toAdd {
basicTags[i] = metaTag(add)
}
Expand All @@ -84,7 +84,7 @@ func addOpenGraph(page *internals.Page, description string) string {
{"og:image:width", "og:image:width", "1280"},
{"og:image:height", "og:image:height", "640"},
{"og:description", "og:description", html.EscapeString(description)}}
opengraphTags := make([]string, 11)
opengraphTags := make([]string, len(toAdd))
for i, add := range toAdd {
opengraphTags[i] = metaTag(add)
}
Expand All @@ -102,7 +102,7 @@ func addTwitterMeta(page *internals.Page, description string) string {
{"twitter:title", "twitter:title", html.EscapeString(flattenFormatting(page.Title))},
{"twitter:description", "twitter:description", html.EscapeString(description)},
}
twitterTags := make([]string, 7)
twitterTags := make([]string, len(toAdd))
for i, add := range toAdd {
twitterTags[i] = metaTag(add)
}
Expand Down

0 comments on commit 942ac48

Please sign in to comment.