generated from nhoizey/pack11ty
-
Notifications
You must be signed in to change notification settings - Fork 1
/
base.njk
134 lines (110 loc) · 5.85 KB
/
base.njk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html lang="en">
<head>
{# {% include "head.njk" %} #}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
{# web-vitals #}
<script>
{% include_raw "node_modules/web-vitals/dist/polyfill.js" %}
</script>
{% from "macros/css.njk" import css %}
{{ css('styles', build.env) }}
{% from "macros/js.njk" import js %}
{{ js('critical', build.env) }}
{% block title %}
{% if page.url == '/' %}
{% set page_title %}{{ site.title }}{% endset %}
{% else %}
{% set page_title %}{{ title }} — {{ site.title }}{% endset %}
{% endif %}
<title>{{ page_title }}</title>
<meta property="og:title" content="{{ page_title }}" />
{% endblock %}
{% block description %}
{# https://stackoverflow.com/q/6203984/717195 #}
<meta name="description" property="og:description" content="{{ site.description }}" />
{% endblock %}
<link rel="canonical" href="{{ site.url + page.url }}" itemprop="url" />
<meta property="og:url" content="{{ site.url + page.url }}" />
{% if page.layout != "page" %}
<meta property="og:type" content="article" />
<meta property="article:published_time" content="{{ page.date | attributeDate }}" />
<meta property="article:author" content="https://www.facebook.com/{{ site.author.facebook }}" />
{% for tag in tags %}
<meta property="article:tag" content="{{ tag }}" />
{% endfor %}
{% endif %}
<meta name="generator" value="{{ eleventy.generator }}" />
{# webmentions with webmention.io #}
<link rel="webmention" href="https://webmention.io/nicolas-hoizey.photo/webmention" />
<link rel="pingback" href="https://webmention.io/nicolas-hoizey.photo/xmlrpc" />
<link rel="alternate" type="application/rss+xml" title="Latest photos from {{ site.title }}" href="/feeds/photos.xml" />
<link rel="alternate" type="application/rss+xml" title="Latest blog posts from {{ site.title }}" href="/feeds/blog.xml" />
<link rel="icon" type="image/jpeg" href="/ui/images/nicolas-hoizey-photography-192px.jpg" />
{# ########################################################
# opengraph and Twitter
# ########################################################}
<meta property="og:site_name" content="{{ site.title }}" />
<meta name="twitter:creator" content="@{{ site.author.twitter }}" />
<meta name="twitter:site" content="@{{ site.author.twitter }}" />
{# https://dev.twitter.com/web/overview/widgets-webpage-properties#csp #}
<meta name="twitter:widgets:csp" content="on" />
{#
https://developers.facebook.com/docs/sharing/best-practices?locale=fr_FR#images
https://developers.facebook.com/tools/debug/sharing/
#}
<meta name="twitter:card" content="summary_large_image" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
{% block opengraphimage %}
{% set photoUrl1 = (site.url + '/photos/the-iconic-acacia-tree-in-front-of-mount-kilimanjaro/the-iconic-acacia-tree-in-front-of-mount-kilimanjaro.jpg') | base64 %}
{% set photoUrl2 = (site.url + '/photos/colourful-netherlands/colourful-netherlands.jpg') | base64 %}
{% set photoUrl3 = (site.url + '/photos/leslie/leslie.jpg') | base64 %}
{% set photoUrl4 = (site.url + '/photos/morning-stroll/morning-stroll.jpg') | base64 %}
{% set photoUrl5 = (site.url + '/photos/women-s-800m/women-s-800m.jpg') | base64 %}
<meta property="og:image" content="{{ site.opengraph.prefix }}/{{ site.opengraph.title.top.before }}:{{ site.description }}/{{ site.opengraph.title.top.after }}/l_fetch:{{ photoUrl1 }},w_200,h_133,c_fill,bo_2px_solid_white/fl_layer_apply,g_south_west,y_288,x_48/l_fetch:{{ photoUrl2 }},w_200,h_133,c_fill,bo_2px_solid_white/fl_layer_apply,g_south_west,y_288,x_273/l_fetch:{{ photoUrl3 }},w_200,h_133,c_fill,bo_2px_solid_white/fl_layer_apply,g_south_west,y_288,x_498/l_fetch:{{ photoUrl4 }},w_200,h_133,c_fill,bo_2px_solid_white/fl_layer_apply,g_south_west,y_288,x_723/l_fetch:{{ photoUrl5 }},w_200,h_133,c_fill,bo_2px_solid_white/fl_layer_apply,g_south_west,y_288,x_948/{{ site.opengraph.background }}" />
{% endblock %}
{# iOS features #}
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="apple-touch-icon" href="/ui/images/nicolas-hoizey-photography-180px.png" />
<meta name="apple-mobile-web-app-title" content="NH photo" />
{# https://timkadlec.com/remembers/2018-06-06-web-watch/ #}
<meta name="disabled-adaptations" content="watch" />
{#
Theme color: https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android
#}
<meta name="theme-color" content="#292929">
{# web app manifest #}
{# crossorigin: https://twitter.com/TimVereecke/status/1225547620791341062 #}
{# <link rel="manifest" href="/manifest.webmanifest" crossorigin="use-credentials" /> #}
{% include 'components/monetization.njk' %}
{% include 'components/matomo.njk' %}
<script>
window.mapboxStyle="{{ map.mapbox.style }}";
</script>
{% block morehead %}{% endblock %}
</head>
<body
data-img-src="{{ page.inputPath | dirname }}/"
data-img-dist="{{ page.outputPath | dirname }}/"
>
<header role="banner">
{% include 'components/logo.njk' %}
{% include 'components/navigation.njk' %}
</header>
<div class="page">
<main id="main" role="main"{% block styles %}{% endblock %}>
{% block content %}
{{ content | safe }}
{% endblock %}
</main>
{% include 'components/footer.njk' %}
</div>
<div style="display: none" aria-hidden="true" class="reusable-icons">
{% icon 'date' %}
</div>
{{ js('additional', build.env) }}
</body>
</html>