|
| 1 | +{% assign page_title = page.title | default: site.title %} |
| 2 | +{% assign page_description = page.description | default: page.podcast.description | default: site.description %} |
| 3 | +{% assign page_url = page.url | default: '/' | prepend: site.baseurl | prepend: site.url %} |
| 4 | + |
| 5 | +{% if page.podcast and page.podcast.image %} |
| 6 | + {% assign image_source = page.podcast.image %} |
| 7 | +{% elsif page.image %} |
| 8 | + {% assign image_source = page.image %} |
| 9 | +{% elsif site.image %} |
| 10 | + {% assign image_source = site.image %} |
| 11 | +{% else %} |
| 12 | + {% assign image_source = '/assets/images/podcasts/01-Fundacao_Angular_Tipagem_Encapsulamento_e_Generics.png' %} |
| 13 | +{% endif %} |
| 14 | + |
| 15 | +{% if image_source contains 'http' %} |
| 16 | + {% assign page_image = image_source %} |
| 17 | +{% else %} |
| 18 | + {% assign image_first_char = image_source | slice: 0, 1 %} |
| 19 | + {% unless image_first_char == '/' %} |
| 20 | + {% assign image_source = image_source | prepend: '/' %} |
| 21 | + {% endunless %} |
| 22 | + {% assign page_image = image_source | prepend: site.baseurl | prepend: site.url %} |
| 23 | +{% endif %} |
| 24 | + |
| 25 | +{% assign page_type = 'website' %} |
| 26 | +{% if page.layout == 'lesson' %} |
| 27 | + {% assign page_type = 'article' %} |
| 28 | +{% endif %} |
| 29 | + |
| 30 | +<meta property="og:type" content="{{ page_type }}"> |
| 31 | +<meta property="og:title" content="{{ page_title }}"> |
| 32 | +<meta property="og:description" content="{{ page_description }}"> |
| 33 | +<meta property="og:url" content="{{ page_url }}"> |
| 34 | +<meta property="og:image" content="{{ page_image }}"> |
| 35 | +<meta property="og:image:width" content="1200"> |
| 36 | +<meta property="og:image:height" content="630"> |
| 37 | +<meta property="og:image:alt" content="{{ page_title }}"> |
| 38 | +<meta property="og:site_name" content="{{ site.title }}"> |
| 39 | +<meta property="og:locale" content="pt_BR"> |
| 40 | + |
| 41 | +<meta name="twitter:card" content="summary_large_image"> |
| 42 | +<meta name="twitter:title" content="{{ page_title }}"> |
| 43 | +<meta name="twitter:description" content="{{ page_description }}"> |
| 44 | +<meta name="twitter:image" content="{{ page_image }}"> |
| 45 | +<meta name="twitter:image:alt" content="{{ page_title }}"> |
| 46 | + |
| 47 | +<link rel="canonical" href="{{ page_url }}"> |
| 48 | + |
0 commit comments