|
4 | 4 | <meta name="theme-color" media="(prefers-color-scheme: dark)" content="#1b1b1e">
|
5 | 5 | <meta name="apple-mobile-web-app-capable" content="yes">
|
6 | 6 | <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
7 |
| - <meta name="viewport" content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover"> |
| 7 | + <meta |
| 8 | + name="viewport" |
| 9 | + content="width=device-width, user-scalable=no initial-scale=1, shrink-to-fit=no, viewport-fit=cover" |
| 10 | + > |
8 | 11 |
|
9 | 12 | {%- capture seo_tags -%}
|
10 | 13 | {% seo title=false %}
|
11 | 14 | {%- endcapture -%}
|
12 | 15 |
|
13 |
| - {% assign img_url = '' %} |
| 16 | + <!-- Setup Open Graph image --> |
14 | 17 |
|
15 | 18 | {% if page.image %}
|
16 | 19 | {% assign src = page.image.path | default: page.image %}
|
| 20 | + |
17 | 21 | {% unless src contains '://' %}
|
18 | 22 | {%- capture img_url -%}
|
19 |
| - {{ site.url }}{% include img-url.html src=src img_path=page.img_path %} |
| 23 | + {% include img-url.html src=src img_path=page.img_path absolute=true %} |
20 | 24 | {%- endcapture -%}
|
| 25 | + |
| 26 | + {%- capture old_url -%}{{ src | absolute_url }}{%- endcapture -%} |
| 27 | + {%- capture new_url -%}{{ img_url }}{%- endcapture -%} |
| 28 | + |
| 29 | + {% assign seo_tags = seo_tags | replace: old_url, new_url %} |
21 | 30 | {% endunless %}
|
| 31 | + |
22 | 32 | {% elsif site.social_preview_image %}
|
23 | 33 | {%- capture img_url -%}
|
24 |
| - {{ site.url }}{% include img-url.html src=site.social_preview_image %} |
| 34 | + {% include img-url.html src=site.social_preview_image absolute=true %} |
25 | 35 | {%- endcapture -%}
|
26 |
| - {% endif %} |
27 | 36 |
|
28 |
| - {% if img_url != '' %} |
29 | 37 | {%- capture og_image -%}
|
30 | 38 | <meta property="og:image" content="{{ img_url }}" />
|
31 |
| - <meta name="twitter:image" content="{{ img_url }}" /> |
32 | 39 | {%- endcapture -%}
|
33 | 40 |
|
34 |
| - {% assign old_meta_clip = '<meta name="twitter:card"' %} |
35 |
| - {% assign new_meta_clip = og_image | append: old_meta_clip %} |
| 41 | + {%- capture twitter_image -%} |
| 42 | + <meta property="twitter:card" content="summary_large_image" /> |
| 43 | + <meta property="twitter:image" content="{{ img_url }}" /> |
| 44 | + {%- endcapture -%} |
| 45 | + |
| 46 | + {% assign old_meta_clip = '<meta name="twitter:card" content="summary" />' %} |
| 47 | + {% assign new_meta_clip = og_image | append: twitter_image %} |
36 | 48 | {% assign seo_tags = seo_tags | replace: old_meta_clip, new_meta_clip %}
|
37 | 49 | {% endif %}
|
38 | 50 |
|
|
58 | 70 |
|
59 | 71 | {% if site.resources.ignore_env != jekyll.environment and site.resources.self_hosted %}
|
60 | 72 | <link href="{{ site.data.origin[type].webfonts | relative_url }}" rel="stylesheet">
|
| 73 | + |
61 | 74 | {% else %}
|
62 | 75 | {% for cdn in site.data.origin[type].cdns %}
|
63 | 76 | <link rel="preconnect" href="{{ cdn.url }}" {{ cdn.args }}>
|
64 | 77 | <link rel="dns-prefetch" href="{{ cdn.url }}" {{ cdn.args }}>
|
65 | 78 | {% endfor %}
|
| 79 | + |
66 | 80 | <link rel="stylesheet" href="{{ site.data.origin[type].webfonts | relative_url }}">
|
67 | 81 | {% endif %}
|
68 | 82 |
|
69 | 83 | <!-- GA -->
|
70 | 84 | {% if jekyll.environment == 'production' and site.google_analytics.id != empty and site.google_analytics.id %}
|
71 | 85 | <link rel="preconnect" href="https://www.google-analytics.com" crossorigin="use-credentials">
|
72 | 86 | <link rel="dns-prefetch" href="https://www.google-analytics.com">
|
| 87 | + |
73 | 88 | <link rel="preconnect" href="https://www.googletagmanager.com" crossorigin="anonymous">
|
74 | 89 | <link rel="dns-prefetch" href="https://www.googletagmanager.com">
|
75 | 90 | {% endif %}
|
|
0 commit comments