Skip to content

Commit

Permalink
Remove social_image_path, use inline conditions for social images
Browse files Browse the repository at this point in the history
  • Loading branch information
mdo committed Jul 26, 2022
1 parent 50fefce commit f7b9fbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
5 changes: 2 additions & 3 deletions config.yml
Expand Up @@ -48,10 +48,9 @@ module:
target: static/favicon.ico

params:
description: "The most popular HTML, CSS, and JS library in the world."
subtitle: "The most popular HTML, CSS, and JS library in the world."
description: "Powerful, extensible, and feature-packed frontend toolkit. Build and customize with Sass, utilize prebuilt grid system and components, and bring projects to life with powerful JavaScript plugins."
authors: "Mark Otto, Jacob Thornton, and Bootstrap contributors"
social_image_path: /docs/5.2/assets/brand/bootstrap-social.png
social_logo_path: /docs/5.2/assets/brand/bootstrap-social-logo.png

current_version: "5.2.0"
current_ruby_version: "5.2.0"
Expand Down
14 changes: 2 additions & 12 deletions site/layouts/partials/social.html
Expand Up @@ -3,12 +3,7 @@
<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 }}">

{{ 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 name="twitter:image" content="/docs/{{ .Site.Params.docs_version }}/assets/{{ if .Page.Params.thumbnail }}img/{{ .Page.Params.thumbnail }}{{else}}brand/bootstrap-social.png{{end}}">

<meta property="og:url" content="{{ .Permalink }}">
<meta property="og:title" content="{{ .Title | markdownify }}">
Expand All @@ -17,9 +12,4 @@
<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 }}
<meta property="og:image" content="/docs/{{ .Site.Params.docs_version }}/assets/{{ if .Page.Params.thumbnail }}img/{{ .Page.Params.thumbnail }}{{else}}brand/bootstrap-social.png{{end}}">

0 comments on commit f7b9fbf

Please sign in to comment.