Add metatags
This commit is contained in:
parent
f296cccd69
commit
bdd140b2de
|
@ -1,6 +1,10 @@
|
|||
name: Oliver Davies
|
||||
description: Lead Software Developer. Freelancer. Drupal and PHP specialist.
|
||||
locale: en-GB
|
||||
|
||||
avatar:
|
||||
url: '/sites/default/files/images/me-precedent.jpg'
|
||||
|
||||
drupalorg:
|
||||
name: opdavies
|
||||
url: 'https://www.drupal.org/u/%drupalorg.name%'
|
||||
|
|
|
@ -4,7 +4,8 @@
|
|||
<link type="text/css" rel="stylesheet" href="/build/app.css"/>
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,300;0,700;1,300&display=swap" rel="stylesheet">
|
||||
{% include 'meta' %}
|
||||
|
||||
{% include 'meta' with { page, site } only %}
|
||||
</head>
|
||||
<body>
|
||||
{% block body %}{% endblock %}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
title: Oliver Davies - UK based PHP Developer and Drupal specialist
|
||||
permalink: /
|
||||
is_front: true
|
||||
---
|
||||
|
||||
<div class="markdown" markdown="1">
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
<title>{{ site.name }}</title>
|
||||
{% set currentUrl = site.url ~ page.url|trim('/', 'right') %}
|
||||
{% set pageTitle = page.title %}
|
||||
{% set siteTitle = site.name %}
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
{% if not page.is_front %}
|
||||
{% set pageTitle = [page.title, '-', site.name]|join(' ') %}
|
||||
{% endif %}
|
||||
|
||||
{% set metaDescription = null %}
|
||||
{% set metaDescription = site.description %}
|
||||
{% if page.meta.description %}
|
||||
{% set metaDescription = page.meta.description|e('html') %}
|
||||
{% elseif page.description %}
|
||||
|
@ -13,6 +15,30 @@
|
|||
{% set metaDescription = page.excerpt|e('html') %}
|
||||
{% endif %}
|
||||
|
||||
{% if metaDescription %}
|
||||
<meta name="description" content="{{ metaDescription }}">
|
||||
{% endif %}
|
||||
{% set metaImage = [
|
||||
site.url,
|
||||
'/',
|
||||
page.meta.image ?? site.avatar.url,
|
||||
]|join %}
|
||||
|
||||
<title>{{ pageTitle }}</title>
|
||||
<link rel="canonical" href="{{ currentUrl }}" />
|
||||
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<meta property="og:site_name" content="{{ siteTitle }}" />
|
||||
<meta property="og:title" content="{{ pageTitle }}" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="{{ currentUrl }}" />
|
||||
|
||||
<meta name="description" content="{{ metaDescription }}">
|
||||
<meta name="og:description" content="{{ metaDescription }}">
|
||||
<meta name="twitter:description" content="{{ metaDescription }}">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:image" content="{{ metaImage }}" />
|
||||
<meta name="twitter:image:alt" content="Page image for {{ site.name }}" />
|
||||
<meta property="og:image" content="{{ metaImage }}" />
|
||||
<meta property="og:image:alt" content="Page image for {{ site.name }}" />
|
||||
|
|
Loading…
Reference in a new issue