File tree Expand file tree Collapse file tree 2 files changed +8
-20
lines changed Expand file tree Collapse file tree 2 files changed +8
-20
lines changed Original file line number Diff line number Diff line change 20
20
21
21
{% unless src contains '://' %}
22
22
{%- capture img_url -%}
23
- {% include img-url.html src=src img_path=page.img_path absolute=true %}
23
+ {% include img-url.html src=src img_path=page.img_path %}
24
24
{%- endcapture -%}
25
25
26
26
{%- capture old_url -%}{{ src | absolute_url }}{%- endcapture -%}
31
31
32
32
{% elsif site.social_preview_image %}
33
33
{%- capture img_url -%}
34
- {% include img-url.html src=site.social_preview_image absolute=true %}
34
+ {% include img-url.html src=site.social_preview_image %}
35
35
{%- endcapture -%}
36
36
37
37
{%- capture og_image -%}
38
38
< meta property ="og:image " content ="{{ img_url }} " />
39
39
{%- endcapture -%}
40
40
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 %}
41
+ {% assign old_meta_clip = '< meta name ="twitter:card "' %}
42
+ {% assign new_meta_clip = og_image | append: old_meta_clip %}
48
43
{% assign seo_tags = seo_tags | replace: old_meta_clip, new_meta_clip %}
49
44
{% endif %}
50
45
90
85
{% endif %}
91
86
92
87
<!-- Bootstrap -->
93
- < link rel ="stylesheet " href ="{{ site.data.origin[type].bootstrap.css | relative_url }} ">
88
+ < link rel ="stylesheet " href ="{{ site.data.origin[type].bootstrap.css | relative_url}} ">
94
89
95
90
<!-- Font Awesome -->
96
91
< link rel ="stylesheet " href ="{{ site.data.origin[type].fontawesome.css | relative_url }} ">
Original file line number Diff line number Diff line change 2
2
Generate image final URL based on `site.img_cdn`, `page.img_path`
3
3
4
4
Arguments:
5
- src - required, basic image path
6
- img_path - optional, relative path of image
7
- absolute - optional, boolean, if true, generate absolute URL
5
+ src - basic image path, required
6
+ img_path - relative path of image, optional
8
7
9
8
Return:
10
9
image URL
15
14
{%- if url -%}
16
15
{% unless url contains ':' %}
17
16
{%- comment -%} CND URL {%- endcomment -%}
18
- {% assign prefix = site.img_cdn | default: '' %}
17
+ {% assign prefix = site.img_cdn | default: '' | relative_url %}
19
18
20
19
{%- comment -%} Add page image path prefix {%- endcomment -%}
21
20
{% assign url = include.img_path | default: '' | append: '/' | append: url %}
27
26
| replace: '//', '/'
28
27
| replace: ':', ':/'
29
28
%}
30
-
31
- {% if include.absolute %}
32
- {% assign url = url | absolute_url %}
33
- {% else %}
34
- {% assign url = url | relative_url %}
35
- {% endif %}
36
29
{% endunless %}
37
30
{%- endif -%}
38
31
You can’t perform that action at this time.
0 commit comments