Skip to content

Commit

Permalink
feat: add open graph meta tags
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrex committed May 23, 2023
1 parent 7ccd0d5 commit adb6cb4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Welcome to Jekyll!
title: Online Resume
description:
url:
baseurl:

Expand All @@ -19,6 +20,9 @@ analytics:
script: https://u.tarrex.com/u.js # umami analytics script src (Replace it with your own config)
website_id: af636e2d-31ae-46f1-9071-82b1745143a9 # umami analytics website id (Replace it with your own config)
domains: tarrex.github.io,tarrex.com # umami analytics domains (Replace it with your own config)
open_graph:
enable: true # enable open graph meta tags
image: '/assets/images/profile.png' # open graph image path

# Style
text_direction: ltr # text direction, 'ltr' or 'rtl'
Expand Down
13 changes: 11 additions & 2 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="{% if site.open %}{{ site.title }}{% endif %}">
<meta name="description" content="{% if site.open %}{% if site.description %}{{ site.description }}{% else %}{{ site.title }}{% endif %}{% else %}Online Resume{% endif %}">

{%- if site.open_graph.enable %}
<meta name="twitter:card" content="summary">
<meta property="og:title" content="{% if site.open %}{{ site.title }}{% else %}Online Resume{% endif %}">
<meta property="og:type" content="profile">
<meta property="og:image" content="{{ site.url }}{{ site.open_graph.image | relative_url }}">
<meta property="og:description" content="{% if site.open %}{% if site.description %}{{ site.description }}{% else %}{{ site.title }}{% endif %}{% else %}Online Resume{% endif %}">
<meta property="og:url" content="{{ site.url }}{{ page.url }}">
{%- endif %}

{%- if site.open %}
<title>{{ site.title }}</title>
Expand Down Expand Up @@ -35,7 +44,7 @@
{% assign umami = site.analytics.umami %}
{%- if umami.script and umami.website_id %}
<!-- Umami Web Analytics -->
<script async defer src="{{ umami.script }}"
<script async defer src="{{ umami.script }}"
data-website-id="{{ umami.website_id }}"
{% if umami.domains %} data-domains="{{ umami.domains }}" {% endif %}></script>
<!-- End Umami Web Analytics -->
Expand Down

0 comments on commit adb6cb4

Please sign in to comment.