Skip to content

Commit

Permalink
Support host og images
Browse files Browse the repository at this point in the history
  • Loading branch information
denny0223 committed Nov 20, 2024
1 parent 6b161de commit 9c16920
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
6 changes: 6 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ collections:
redirects:
output: true
permalink: /:path/

include:
- images

keep_files:
- images
8 changes: 7 additions & 1 deletion _layouts/redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@
<meta name="author" content="SITCON">
<meta property="og:title" content="{{ page.title }}">
<meta property="og:description" content="{{ page.description }}">
<meta property="og:image" content="{{ page.image }}">
{% if page.image %}
{% if page.image contains "://" %}
<meta property="og:image" content="{{ page.image }}">
{% else %}
<meta property="og:image" content="{{ site.url }}{{ page.image | relative_url }}">
{% endif %}
{% endif %}
<meta property="og:site_name" content="SITCON">
<meta property="og:locale" content="zh_TW">
<script>
Expand Down
7 changes: 7 additions & 0 deletions _redirects/template-with-img.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: redirect
title: "自定義標題"
description: "自定義描述"
image: "/images/withname.png"
redirect_to: "https://sitcon.org/"
---
Binary file added images/withname.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9c16920

Please sign in to comment.