Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support open graph #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ description: >- # this means to ignore newlines until "baseurl:"
Write an awesome description for your new site here. You can edit this
line in _config.yml. It will appear in your document head meta (for
Google search results) and in your feed.xml site description.

image: ""
baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
favicon: "" # the favicon for your site
Expand Down
19 changes: 19 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="google-translate-customization" content="108d9124921d80c3-80e20d618ff053c8-g4f02ec6f3dba68b7-c"></meta>
{%- seo -%}
{% if page.title %}
<meta property="og:title" content="{{ site.title }} :: {{ page.title }}">
<meta property="og:type" content="article">
{% if page.subtitle %}
<meta property="og:description" content="{{ post.subtitle }}">
{% else %}
<meta property="og:description" content="{{ site.description }}">
{% endif %}
{% if page.banner %}
<meta property="og:image" content="{{ page.banner }}">
{% else %}
<meta property="og:image" content="{{ site.image }}">
{% endif %}
{% else %}
<meta property="og:title" content="{{ site.title }}">
<meta property="og:type" content="website">
<meta property="og:description" content="{{ site.description }}">
<meta property="og:image" content="{{ site.image }}">
{% endif %}
<link rel="shortcut icon" href="{{ site.favicon }}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/index.min.css">
Expand Down