Skip to content

Commit 60c0472

Browse files
committed
add card_image front matter
1 parent e6070cc commit 60c0472

File tree

2 files changed

+31
-14
lines changed

2 files changed

+31
-14
lines changed

_includes/head.html

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,40 +16,56 @@
1616

1717
<!-- Setup Open Graph image -->
1818

19-
{% if page.image %}
20-
{% assign src = page.image.path | default: page.image %}
19+
{% if page.card_image %}
20+
{%- capture img_url -%}
21+
{% include img-url.html src=page.card_image absolute=true %}
22+
{%- endcapture -%}
2123

24+
{%- capture og_image -%}
25+
<meta property="og:image" content="{{ img_url }}" />
26+
{%- endcapture -%}
27+
28+
{%- capture twitter_image -%}
29+
<meta name="twitter:card" content="summary_large_image" />
30+
<meta property="twitter:image" content="{{ img_url }}" />
31+
{%- endcapture -%}
32+
33+
{% assign new_meta_clip = og_image | append: twitter_image %}
34+
{% assign seo_tags = seo_tags | replace: '<meta name="twitter:card" content="summary" />', new_meta_clip %}
35+
36+
{% elsif page.image %}
37+
{% assign src = page.image.path | default: page.image %}
2238
{% unless src contains '://' %}
23-
{%- capture img_url -%}
24-
{% include img-url.html src=src img_path=page.img_path absolute=true %}
25-
{%- endcapture -%}
39+
{%- capture img_url -%}
40+
{% include img-url.html src=src img_path=page.img_path absolute=true %}
41+
{%- endcapture -%}
2642

27-
{%- capture old_url -%}{{ src | absolute_url }}{%- endcapture -%}
28-
{%- capture new_url -%}{{ img_url }}{%- endcapture -%}
43+
{%- capture old_url -%}{{ src | absolute_url }}{%- endcapture -%}
44+
{%- capture new_url -%}{{ img_url }}{%- endcapture -%}
2945

30-
{% assign seo_tags = seo_tags | replace: old_url, new_url %}
46+
{% assign seo_tags = seo_tags | replace: old_url, new_url %}
3147
{% endunless %}
3248

3349
{% elsif site.social_preview_image %}
3450
{%- capture img_url -%}
35-
{% include img-url.html src=site.social_preview_image absolute=true %}
51+
{% include img-url.html src=site.social_preview_image absolute=true %}
3652
{%- endcapture -%}
3753

3854
{%- capture og_image -%}
39-
<meta property="og:image" content="{{ img_url }}" />
55+
<meta property="og:image" content="{{ img_url }}" />
4056
{%- endcapture -%}
4157

4258
{%- capture twitter_image -%}
43-
<meta name="twitter:card" content="summary_large_image" />
44-
<meta property="twitter:image" content="{{ img_url }}" />
59+
<meta name="twitter:card" content="summary_large_image" />
60+
<meta property="twitter:image" content="{{ img_url }}" />
4561
{%- endcapture -%}
46-
62+
4763
{% assign old_meta_clip = '<meta name="twitter:card" content="summary" />' %}
4864
{% assign new_meta_clip = og_image | append: twitter_image %}
4965
{% assign seo_tags = seo_tags | replace: old_meta_clip, new_meta_clip %}
5066
{% endif %}
5167

52-
{{ seo_tags }}
68+
{{ seo_tags }}
5369

5470
<title>
5571
{%- unless page.layout == 'home' -%}

_posts/writeups/2024/2024-06-27-off-by-one-badge-2024.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ categories: [Writeups]
66
img_path: /assets/posts/2024-06-27-off-by-one-badge-2024/
77
tags: [hardware]
88
toc: True
9+
card_image: powerpuff_girls.jpg
910
---
1011

1112
I attended the first ever Vulnerability Research based cybersecurity conference in Singapore -- [**Off By One**](https://offbyone.sg/) organized by __[Star Labs](https://starlabs.sg/), [Eugene Lim](https://spaceraccoon.dev) and [Sim Cher Boon](https://twitter.com/cherboon)__ -- and had an amazing time!

0 commit comments

Comments
 (0)