Refactor head file to be a bit more modular
This commit is contained in:
parent
992dc53720
commit
63cc0d2f11
@ -1,71 +1,51 @@
|
||||
<head>
|
||||
|
||||
{% capture title %}
|
||||
{% if page.title %}
|
||||
{{ page.title }}
|
||||
{% else %}
|
||||
Andrew Cassidy
|
||||
{% endif %}
|
||||
{% endcapture %}
|
||||
|
||||
{% capture description %}
|
||||
{% if page.description%}
|
||||
{{ page.description}}
|
||||
{% else %}
|
||||
{{page.content | markdownify | strip_html | truncate: 100}}
|
||||
{% endif %}
|
||||
{% endcapture %}
|
||||
|
||||
{% capture image %}
|
||||
{{site.url}}/images/{{page.path | split: '/' | last | split: '.' | first }}/{{page.image}}
|
||||
{% endcapture %}
|
||||
|
||||
<title>{{title}}</title>
|
||||
|
||||
<meta charset=utf-8 />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- Twitter cards -->
|
||||
<meta name="twitter:card" content="summary"/>
|
||||
<meta name="twitter:site" conten="@AndrewNCassidy"/>
|
||||
<meta name="twitter:title" content="{{title}}"/>
|
||||
<meta name="twitter:description" content="{{description}}"/>
|
||||
|
||||
{% if page.image %}
|
||||
<meta name="twitter:image" content="{{image}}"/>
|
||||
{% endif %}
|
||||
|
||||
<!-- Opengraph -->
|
||||
<meta property="og:url" content="{{site.url}}{{page.url}}"/>
|
||||
<meta property="og:title" content="{{title}}"/>
|
||||
<meta property="og:image" content="{{description}}"/>
|
||||
|
||||
{% if page.image %}
|
||||
<meta property="og:image" content="{{image}}"/>
|
||||
{% endif %}
|
||||
|
||||
{% if page.collection == "posts" %}
|
||||
<meta property="og:type"
|
||||
content="article"/>
|
||||
<meta property="article:published_time"
|
||||
content="{{ page.date | date_to_xmlschema }}"/>
|
||||
<meta property="article:section"
|
||||
content="Blog"/>
|
||||
|
||||
{% for tag in page.tags %}
|
||||
<meta property="article:tag" content="{{ tag }}"/>
|
||||
{% endfor %}
|
||||
|
||||
{% capture title %}
|
||||
{% if page.title %}
|
||||
{{ page.title }}
|
||||
{% else %}
|
||||
<meta property="og:type"
|
||||
content="website"/>
|
||||
Andrew Cassidy
|
||||
{% endif %}
|
||||
{% endcapture %}
|
||||
|
||||
<link rel="stylesheet" href="/fa/css/fontawesome.min.css">
|
||||
<link rel="stylesheet" href="/fa/css/brands.min.css">
|
||||
<link rel="stylesheet" href="/fa/css/solid.min.css">
|
||||
{% capture description %}
|
||||
{% if page.description%}
|
||||
{{ page.description}}
|
||||
{% else %}
|
||||
{{page.content | markdownify | strip_html | truncate: 100}}
|
||||
{% endif %}
|
||||
{% endcapture %}
|
||||
|
||||
<link rel="stylesheet" href="/css/fnoots.css"/>
|
||||
<link rel="stylesheet" href="/css/site.css"/>
|
||||
<link rel="stylesheet" href="/css/sidebar.css"/>
|
||||
</head>
|
||||
{% capture image %}
|
||||
{{site.url}}/images/{{page.path | split: '/' | last | split: '.' | first }}/{{page.image}}
|
||||
{% endcapture %}
|
||||
|
||||
<title>{{title}}</title>
|
||||
|
||||
<meta charset=utf-8 />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- Twitter cards -->
|
||||
<meta name="twitter:card" content="summary"/>
|
||||
<meta name="twitter:site" conten="@AndrewNCassidy"/>
|
||||
<meta name="twitter:title" content="{{title}}"/>
|
||||
<meta name="twitter:description" content="{{description}}"/>
|
||||
|
||||
{% if page.image %}
|
||||
<meta name="twitter:image" content="{{image}}"/>
|
||||
{% endif %}
|
||||
|
||||
<!-- Opengraph -->
|
||||
<meta property="og:url" content="{{site.url}}{{page.url}}"/>
|
||||
<meta property="og:title" content="{{title}}"/>
|
||||
<meta property="og:image" content="{{description}}"/>
|
||||
|
||||
{% if page.image %}
|
||||
<meta property="og:image" content="{{image}}"/>
|
||||
{% endif %}
|
||||
|
||||
<link rel="stylesheet" href="/fa/css/fontawesome.min.css">
|
||||
<link rel="stylesheet" href="/fa/css/brands.min.css">
|
||||
<link rel="stylesheet" href="/fa/css/solid.min.css">
|
||||
|
||||
<link rel="stylesheet" href="/css/fnoots.css"/>
|
||||
<link rel="stylesheet" href="/css/site.css"/>
|
||||
<link rel="stylesheet" href="/css/sidebar.css"/>
|
@ -1,7 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
{% include head.html %}
|
||||
<head>
|
||||
{% include head.html %}
|
||||
<meta property="og:type" content="website"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
|
@ -1,7 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
{% include head.html %}
|
||||
<head>
|
||||
{% include head.html %}
|
||||
<meta property="og:type" content="website"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
|
@ -1,7 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
{% include head.html %}
|
||||
<head>
|
||||
{% include head.html %}
|
||||
<meta property="og:type" content="website"/>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
|
@ -1,7 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
{% include head.html %}
|
||||
<head>
|
||||
{% include head.html %}
|
||||
<meta property="og:type"
|
||||
content="article"/>
|
||||
<meta property="article:published_time"
|
||||
content="{{ page.date | date_to_xmlschema }}"/>
|
||||
<meta property="article:section"
|
||||
content="Blog"/>
|
||||
|
||||
{% for tag in page.tags %}
|
||||
<meta property="article:tag" content="{{ tag }}"/>
|
||||
{% endfor %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header>
|
||||
|
Loading…
Reference in New Issue
Block a user