Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify social images and add ability to set per-page images
- Removes the homepage summary layout in favor of the larger image card (makes it more consistent with other pages) - Reuses new thumbnails for Webpack, Parcel, and Vite guides to add their new social images
- Loading branch information
Showing
4 changed files
with
16 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
{{ "<!-- Twitter -->" | safeHTML }} | ||
<meta name="twitter:card" content="{{ if .IsHome }}summary_large_image{{ else }}summary{{ end }}"> | ||
<meta name="twitter:card" content="summary_large_image"> | ||
<meta name="twitter:site" content="@{{ .Site.Params.twitter }}"> | ||
<meta name="twitter:creator" content="@{{ .Site.Params.twitter }}"> | ||
<meta name="twitter:title" content="{{ .Title | markdownify }}"> | ||
<meta name="twitter:description" content="{{ .Page.Params.description | default .Site.Params.description | markdownify }}"> | ||
<meta name="twitter:image" content="{{ if .IsHome }}{{ .Site.Params.social_logo_path | absURL }}{{ else }}{{ .Site.Params.social_image_path | absURL }}{{ end }}"> | ||
|
||
{{ "<!-- Facebook -->" | safeHTML }} | ||
{{ if .Page.Params.thumbnail }} | ||
<meta name="twitter:image" content="/docs/{{ .Site.Params.docs_version }}/assets/img/{{ .Page.Params.thumbnail }}"> | ||
{{ else }} | ||
<meta name="twitter:image" content="{{ .Site.Params.social_image_path | absURL }}"> | ||
{{ end }} | ||
|
||
<meta property="og:url" content="{{ .Permalink }}"> | ||
<meta property="og:title" content="{{ .Title | markdownify }}"> | ||
<meta property="og:description" content="{{ .Page.Params.description | default .Site.Params.description | markdownify }}"> | ||
<meta property="og:type" content="{{ if .IsPage }}article{{ else }}website{{ end }}"> | ||
<meta property="og:image" content="{{ .Site.Params.social_image_path | absURL }}"> | ||
<meta property="og:image:type" content="image/png"> | ||
<meta property="og:image:width" content="1000"> | ||
<meta property="og:image:height" content="500"> | ||
|
||
{{ if .Page.Params.thumbnail }} | ||
<meta property="og:image" content="/docs/{{ .Site.Params.docs_version }}/assets/img/{{ .Page.Params.thumbnail }}"> | ||
{{ else }} | ||
<meta property="og:image" content="{{ .Site.Params.social_image_path | absURL }}"> | ||
{{ end }} |