Skip to content
This repository was archived by the owner on Apr 21, 2022. It is now read-only.

Use og:image to display avatar #84

Merged
merged 2 commits into from
Mar 25, 2019
Merged
Changes from 1 commit
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
Prev Previous commit
added more og tags; dynamic page title
  • Loading branch information
brandonrosage committed Mar 25, 2019
commit 7a04f13ced2f4bc8cca82ccf961ff2f39a4f2098
10 changes: 7 additions & 3 deletions _includes/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@
{% assign user = site.github.owner %}

{% if page.path contains '_posts' %}
{% assign page_title = page.title %}
{% assign meta_description = page.content | strip_html | strip_newlines | xml_escape | truncate: 300 %}
{% else %}
{% assign page_title = user.name %}
{% assign meta_description = user.bio | strip_html | strip_newlines | xml_escape | truncate: 300 %}
{% endif %}

<!doctype html>
<html class="height-full">
<html>
<head>
<meta charset="utf-8">
<title>{{ page_title }}</title>
<meta name="description" content="{{ meta_description }}" />
<meta name="og:image" content="{{ user.avatar_url }}" />
<title>{{ user.name }}</title>
<meta property="og:title" content="{{ user.name }}" />
<meta property="og:image" content="{{ user.avatar_url }}" />
<meta property="og:description" content="{{ meta_description }}" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="{{ "/assets/styles.css" | relative_url }}" rel="stylesheet" type="text/css">
</head>
Expand Down