Skip to content

Commit e93f638

Browse files
기본 레이아웃의 Open Graph 메타 태그 개선. 포스트 레이아웃에 따라 동적으로 OG 이미지를 선택하도록 수정하여, 이미지의 일관성을 높이고 SEO 최적화를 강화하였습니다.
1 parent 70f76df commit e93f638

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

_layouts/default.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,26 @@
4545
<!-- Theme color -->
4646
<meta name="theme-color" content="#2563eb">
4747

48+
<!-- Dynamic OG Image Selection -->
49+
{% if page.layout == "post" %}
50+
{% assign og_image = page.og_image | default: page.image | default: '/assets/images/character.svg' %}
51+
{% else %}
52+
{% assign og_image = '/assets/images/character.svg' %}
53+
{% endif %}
54+
4855
<!-- Open Graph / Facebook -->
4956
<meta property="og:type" content="website">
5057
<meta property="og:url" content="{{ page.url | absolute_url }}">
5158
<meta property="og:title" content="{{ page.title | default: lang_data.site.title }}">
5259
<meta property="og:description" content="{{ page.description | default: lang_data.site.description }}">
53-
<meta property="og:image" content="{{ '/assets/images/og-image.png' | absolute_url }}">
60+
<meta property="og:image" content="{{ og_image | absolute_url }}">
5461

5562
<!-- Twitter -->
5663
<meta property="twitter:card" content="summary_large_image">
5764
<meta property="twitter:url" content="{{ page.url | absolute_url }}">
5865
<meta property="twitter:title" content="{{ page.title | default: lang_data.site.title }}">
5966
<meta property="twitter:description" content="{{ page.description | default: lang_data.site.description }}">
60-
<meta property="twitter:image" content="{{ '/assets/images/og-image.png' | absolute_url }}">
67+
<meta property="twitter:image" content="{{ og_image | absolute_url }}">
6168

6269
<!-- SEO Tags -->
6370
{% seo %}

0 commit comments

Comments
 (0)