Skip to content

Commit

Permalink
Fix deprecated warnings for .Site.Social and .Site.Authors (#1812)
Browse files Browse the repository at this point in the history
* Fixed deprecated warnings for .Site.Social and .Site.Authors
* Fixed title case on twitter username

---------

Signed-off-by: Travis Beckham <[email protected]>
  • Loading branch information
travisbeckham authored Aug 5, 2024
1 parent d2eec6a commit cee5fbc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions linkerd.io/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ title = "Linkerd"
latest_release_version = "1.7.5"
latest_linkerd2_stable_version = "2.15"
logo = "/images/identity/png/transparent_background/1x/linkerd_primary_color_black_transparent.png"
[params.social]
twitter = "Linkerd"
[permalinks]
blog = "/:year/:month/:day/:slug/"
[privacy.twitter]
Expand Down
21 changes: 11 additions & 10 deletions linkerd.io/themes/buoyant/layouts/partials/twitter-cards.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
{{ end }}
<meta name="twitter:title" content="{{ .Title }}"/>
<meta name="twitter:description" content="{{ partial "description.html" . }}" />
{{ with .Site.Social.twitter -}}
<meta name="twitter:site" content="@{{ . }}"/>
{{ end -}}
{{ range .Site.Authors }}
{{ with .twitter -}}
<meta name="twitter:creator" content="@{{ . }}"/>
{{ end -}}
{{ end -}}


{{ with site.Params.social }}
{{ if reflect.IsMap . }}
{{ with .twitter }}
{{ $content := . }}
{{ if not (strings.HasPrefix . "@") }}
{{ $content = printf "@%v" . }}
{{ end }}
<meta name="twitter:site" content="{{ $content }}">
{{ end }}
{{ end }}
{{ end }}

0 comments on commit cee5fbc

Please sign in to comment.