refactor: rename _partials
to _includes
This commit is contained in:
parent
0482badc95
commit
a445072048
17 changed files with 0 additions and 0 deletions
16
source/_includes/about-author.html.twig
Normal file
16
source/_includes/about-author.html.twig
Normal file
|
@ -0,0 +1,16 @@
|
|||
<aside>
|
||||
<h2>About Me</h2>
|
||||
|
||||
<div class="flex mt-4 space-x-4">
|
||||
<div class="flex-shrink-0">
|
||||
<img src="{{ avatar.url }}" alt="Picture of Oliver" class="w-16 h-16 border rounded-full border-gray">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p>
|
||||
Oliver Davies is a PHP Developer and Linux Systems Administrator based in the UK.
|
||||
He is a {{ work.role }} at <a href="{{ work.company.url }}?utm_source=oliverdavies.uk&utm_medium=about-author" class="link">{{ work.company.name }}</a> and a Full Stack Software Consultant specialising in Drupal and Symfony application development.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
8
source/_includes/figure.html.twig
Normal file
8
source/_includes/figure.html.twig
Normal file
|
@ -0,0 +1,8 @@
|
|||
<figure class="block">
|
||||
<img src="{{ image.src }}" alt="{{ image.alt }}" class="p-1 border">
|
||||
{% if caption %}
|
||||
<figcaption class="mt-1 mb-0 italic text-sm text-center text-gray-800">
|
||||
{{ caption }}
|
||||
</figcaption>
|
||||
{% endif %}
|
||||
</figure>
|
7
source/_includes/footer.html.twig
Normal file
7
source/_includes/footer.html.twig
Normal file
|
@ -0,0 +1,7 @@
|
|||
<footer class="mt-20">
|
||||
<nav class="flex flex-wrap justify-center -mb-3">
|
||||
{% for link in site.menus.footer %}
|
||||
<a class="mx-3 mb-3 text-sm md:text-lg dark:text-white hover:text-gray-900 dark:hover:text-blue-400 link" href="{{ link.href }}">{{ link.title }}</a>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
</footer>
|
48
source/_includes/meta.html.twig
Normal file
48
source/_includes/meta.html.twig
Normal file
|
@ -0,0 +1,48 @@
|
|||
{% set currentUrl = site.url ~ page.url|trim('/', 'right') %}
|
||||
{% set pageTitle = page.title %}
|
||||
{% set siteTitle = site.name %}
|
||||
|
||||
{% if not page.is_front %}
|
||||
{% set pageTitle = [page.title, '-', site.name]|join(' ') %}
|
||||
{% endif %}
|
||||
|
||||
{% if page.meta.title %}
|
||||
{% set pageTitle = page.meta.title %}
|
||||
{% endif %}
|
||||
|
||||
{% set metaDescription = site.description %}
|
||||
{% if page.meta.description %}
|
||||
{% set metaDescription = page.meta.description|e('html') %}
|
||||
{% elseif page.description %}
|
||||
{% set metaDescription = page.description|e('html') %}
|
||||
{% elseif page.excerpt %}
|
||||
{% set metaDescription = page.excerpt|e('html') %}
|
||||
{% 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 }}" />
|
30
source/_includes/navbar.html.twig
Normal file
30
source/_includes/navbar.html.twig
Normal file
|
@ -0,0 +1,30 @@
|
|||
<div>
|
||||
<div class="max-w-2xl px-4 py-4 mx-auto">
|
||||
<div class="flex flex-col items-center justify-between md:flex-row">
|
||||
<div>
|
||||
<a href="/">
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
class="w-16 h-16 text-blue-primary fill-current dark:text-blue-400 md:w-18 md:h-18"
|
||||
viewBox="0 0 706 504"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path d="M456.5 1.1c-12.3 1.5-31 5.5-44.1 9.4-12.7 3.9-63.6 24.6-64.1 26.2-.2.5 1.4 1.7 3.4 2.7 2.1 1 8.9 5.1 15.1 9.2l11.2 7.5 14.5-6c22.9-9.5 37.3-14 57.5-17.8 7.2-1.3 14.7-1.7 31-1.8 18.6 0 23.1.3 33 2.3 22 4.5 46.1 13.9 64.5 25.2 39.3 24.2 69.9 65.3 86.9 116.5 16.3 49.2 13 100.2-9.4 145.3-21.8 43.7-49.2 68.8-101.5 92.9-13.4 6.2-120.1 51.3-121.3 51.3-.5 0-15.7-35.1-33.7-78l-32.8-78 3.1-12.8c4.4-18 5.6-29.5 4.9-48.5-.6-16.8-2-25.7-6.3-38.7-12-35.8-40.8-69.2-74-85.6l-7.2-3.6-4.2-10c-2.4-5.6-3.9-10.3-3.4-10.7.5-.5 9.7-4.5 20.4-9s19.9-8.6 20.4-9.1c1.5-1.5-18.6-10.1-32.3-13.9l-6.8-1.9-20.6 8.7c-11.4 4.8-20.9 8.9-21.2 9.2-.2.3 2 6.3 5 13.3 3 7 5.5 12.8 5.5 12.9 0 .1-7.5.2-16.7.2-11.8.1-19.4.6-25.6 1.8-27.3 5.5-50.5 17.6-70.4 37-21.8 21.2-36.7 49-43 80.2-2.4 12.3-2.4 44 0 57.2 3.6 19.4 11.9 40.4 22.3 56 6.9 10.4 21.1 25.4 31.2 33 29.9 22.5 70.8 33.2 106.2 27.8 18.9-2.8 39.3-10.6 54.1-20.5 13.5-9.1 29.1-23.8 37.6-35.5 1.2-1.7 2.4-2.8 2.7-2.5.3.3 15.6 36.6 34.1 80.5 18.5 44 33.8 80.1 33.9 80.3.8.8 144.9-60.8 162.1-69.3 45.5-22.4 73.4-47.1 95.7-84.7 28-47.4 37.5-99.7 27.8-153.5-6.8-37.6-25-79-48.6-110.3-33.2-44.1-83-74.2-138.4-83.6-11.4-1.9-46.9-2.7-58.5-1.3zM259.2 141.4c42.4 10.9 77.8 50 84.8 93.8 1.6 9.9.8 34.5-1.4 44.8-5.2 24-15.5 43-32.6 60-20.7 20.6-42.8 31.3-67.7 32.7-26.9 1.5-53.2-6.2-74.3-21.7-29.4-21.7-46-56.2-46-95.7 0-45.4 27.2-89.6 66.1-107.2 8.2-3.7 21.7-7.9 29.4-9.1 10.4-1.6 30.8-.4 41.7 2.4z"/><path d="M201 20.6c-83 11.2-157 71-186.5 150.8-22.3 60.3-18.3 134.9 10.2 192 21.5 43.1 59.6 81.6 102.1 103.4 21.1 10.9 46.3 19 71.2 22.9 16.2 2.5 53.1 2.5 68.5 0 25.9-4.2 45.2-10.5 69-22.2 14.4-7.1 39.7-23.2 41.8-26.7.8-1.2-.2-4.6-4.3-14.5-2.9-7-5.7-13.2-6.1-13.7-.5-.5-4.3 1.7-8.6 5.1C320 447.1 277.6 462 232 462c-59.8 0-115.2-26.3-154.8-73.5-32.2-38.3-48.8-88.7-46.9-142 2-53.7 22.1-99.6 60.7-138.5 28.1-28.3 63-47.2 102.9-55.7 11.9-2.6 14.1-2.8 38.6-2.8 28.3 0 39.4 1.3 59 7 27.9 8.1 58.5 26.1 80.9 47.6l10.9 10.5-14.3 6c-7.8 3.2-14.5 6.4-14.7 7-.2.7 16.5 41.3 37.1 90.4 20.7 49.1 37.6 90.1 37.6 91.1 0 3.4-7.1 24.2-11.6 33.8-2.4 5.1-6.6 13.1-9.4 17.7l-5 8.3 6.6 15.6c5.5 12.9 6.9 15.4 8 14.4 2.8-2.3 19.2-27.8 24.4-37.9l5.3-10.3 8.3 19.8c4.7 10.9 8.7 20.1 8.9 20.3.6.6 60.8-24.6 74.5-31.2 29.7-14.2 52.7-35.8 65.3-61.1 16.9-34 17.6-70.8 2.2-112-17-45.3-45.8-76.7-82.5-90-18.2-6.5-43.1-9.1-63.5-6.5-11.5 1.4-30 5.8-40.3 9.5l-7.3 2.6L402.3 91c-20.3-21.3-37.9-34.3-65.4-48.3-33.4-17.1-63.7-23.8-105.9-23.6-10.7.1-24.2.7-30 1.5zM504.5 122c9.2 2.5 22.1 8.3 29.2 13.1 6.9 4.7 18.7 16.3 24.3 23.9 15.1 20.6 26.3 49 29 74 2.3 20.7-3.1 43-14.5 60.5-8.7 13.3-27.6 29.5-44.5 38-6 3.1-47.3 20.6-47.5 20.2-1.1-1.6-87.5-208-87.3-208.3.2-.2 7.4-3.3 15.8-6.9 22.5-9.5 33.8-13 55-16.9 1.4-.2 9.3-.3 17.5-.1 11.5.2 16.9.8 23 2.5z"/>
|
||||
</svg>
|
||||
<span class="sr-only">
|
||||
{{ site.name }}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<nav class="flex items-center mt-4 space-x-6 md:mt-0 md:flex-row">
|
||||
{% for item in site.menus.main %}
|
||||
{% set is_active = page.url matches '#' ~ item.is_active ~ '#' %}
|
||||
<a class="text-black dark:text-white border-b-3 py-2 hover:border-gray-300 {{ is_active ? 'border-blue-primary dark:border-blue-400' : 'border-transparent' }}" href="{{ item.href }}">{{ item.title }}</a>
|
||||
{% endfor %}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
4
source/_includes/plausible.html.twig
Normal file
4
source/_includes/plausible.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% if plausible.domain %}
|
||||
<script defer data-domain="{{ plausible.domain }}" src="https://plausible.io/js/plausible.js"></script>
|
||||
<script>window.plausible = window.plausible || function() { (window.plausible.q = window.plausible.q || []).push(arguments) }</script>
|
||||
{% endif %}
|
3
source/_includes/post/comments-questions.html.twig
Normal file
3
source/_includes/post/comments-questions.html.twig
Normal file
|
@ -0,0 +1,3 @@
|
|||
<footer>
|
||||
<p>Comments or questions? I'm <a class="link" href="{{ twitter.url }}">@{{ twitter.name }}</a> on Twitter.</p>
|
||||
</footer>
|
15
source/_includes/post/old-post-message.html.twig
Normal file
15
source/_includes/post/old-post-message.html.twig
Normal file
|
@ -0,0 +1,15 @@
|
|||
{% macro shouldDisplayOldPostMessage(post) %}
|
||||
{% set cutOffDate = 'today -1 year'|date('U') %}
|
||||
|
||||
{% if post.date is not empty %}
|
||||
{{ post.date <= cutOffDate }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% import _self as helpers %}
|
||||
|
||||
{% if helpers.shouldDisplayOldPostMessage(post)|trim %}
|
||||
<div class="p-6 my-10 border border-gray-300 dark:bg-gray-800 dark:border-gray-700">
|
||||
<p><strong>Warning:</strong> This post is over a year old. I don't always update old posts with new information, so some of this information may be out of date.</p>
|
||||
</div>
|
||||
{% endif %}
|
13
source/_includes/post/post-teaser.html.twig
Normal file
13
source/_includes/post/post-teaser.html.twig
Normal file
|
@ -0,0 +1,13 @@
|
|||
<article>
|
||||
<h2>
|
||||
<a class="text-blue-primary dark:text-blue-400" href="{{ post.url }}">
|
||||
{{ post.title }}
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<time class="text-base" datetime="{{ post.date|date('Y-m-d') }}">
|
||||
{{ post.date|date('jS F Y') }}
|
||||
</time>
|
||||
|
||||
<p class="mt-1">{{ post.excerpt }}</p>
|
||||
</article>
|
9
source/_includes/speakerdeck.html.twig
Normal file
9
source/_includes/speakerdeck.html.twig
Normal file
|
@ -0,0 +1,9 @@
|
|||
<div class="slides">
|
||||
<noscript>**Please enable JavaScript to view slides.**</noscript>
|
||||
<script
|
||||
class="speakerdeck-embed"
|
||||
data-id="{{ data.id }}"
|
||||
data-ratio="{{ data.ratio ?: '1.29456384323641' }}"
|
||||
src="//speakerdeck.com/assets/embed.js"
|
||||
></script>
|
||||
</div>
|
17
source/_includes/talk/events.html.twig
Normal file
17
source/_includes/talk/events.html.twig
Normal file
|
@ -0,0 +1,17 @@
|
|||
{% if events is not empty %}
|
||||
<div class="markdown">
|
||||
<h2>Events</h2>
|
||||
|
||||
<ul>
|
||||
{% for event in events|sort((a, b) => a.date > b.date) %}
|
||||
{% include 'talk/events/event.html.twig' with {
|
||||
date: event.date,
|
||||
is_online: event.is_online ?? false,
|
||||
location: event.location,
|
||||
name: event.name,
|
||||
url: event.url,
|
||||
} only %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
10
source/_includes/talk/events/event.html.twig
Normal file
10
source/_includes/talk/events/event.html.twig
Normal file
|
@ -0,0 +1,10 @@
|
|||
<li>
|
||||
{% if url %}
|
||||
<a href="{{ url }}">{{ name }}</a>
|
||||
{% else %}
|
||||
{{ name }}
|
||||
{% endif %}
|
||||
{% if location %}in {{ location }}{% endif %}
|
||||
- {{ date|date('jS F Y') }}
|
||||
{{ is_online ? '(online)' }}
|
||||
</li>
|
9
source/_includes/talk/slides.html.twig
Normal file
9
source/_includes/talk/slides.html.twig
Normal file
|
@ -0,0 +1,9 @@
|
|||
{% if speakerdeck.id and speakerdeck.ratio %}
|
||||
<div>
|
||||
<h2 class="mb-2">Slides</h2>
|
||||
|
||||
{% include 'speakerdeck' with {
|
||||
data: speakerdeck,
|
||||
} only %}
|
||||
</div>
|
||||
{% endif %}
|
28
source/_includes/talk/video.html.twig
Normal file
28
source/_includes/talk/video.html.twig
Normal file
|
@ -0,0 +1,28 @@
|
|||
{% macro videoSrc(video) %}
|
||||
{% set srcUrls = {
|
||||
youtube: '//www.youtube.com/embed',
|
||||
videopress: 'https://videopress.com/embed',
|
||||
vimeo: 'https://player.vimeo.com/video',
|
||||
} %}
|
||||
|
||||
{{ srcUrls[video.type] ~ '/' ~ video.id }}
|
||||
{% endmacro %}
|
||||
|
||||
{% from _self import videoSrc %}
|
||||
|
||||
{% if video.id %}
|
||||
<div class="mt-4">
|
||||
<h2 class="mb-2">Video</h2>
|
||||
|
||||
<div class="video-full">
|
||||
<iframe
|
||||
width="678"
|
||||
height="408"
|
||||
src="{{ videoSrc(video) }}"
|
||||
frameborder="0"
|
||||
allowfullscreen
|
||||
>
|
||||
</iframe>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
17
source/_includes/test-driven-drupal-subscribe-form.html.twig
Normal file
17
source/_includes/test-driven-drupal-subscribe-form.html.twig
Normal file
|
@ -0,0 +1,17 @@
|
|||
<p><strong>Enter your email address to subscribe to the Test-Driven Drupal mailing list
|
||||
and be notified of any updates.</strong></p>
|
||||
|
||||
<div class="w-full lg:w-2/3">
|
||||
<form action="https://oliverdavi.us18.list-manage.com/subscribe/post?u=b4ac8dd177796d37b93f9c285&amp;id=033c84e0d5" method="post" name="mc-embedded-subscribe-form" novalidate="">
|
||||
<div id="mc_embed_signup_scroll">
|
||||
<div style="position: absolute; left: -5000px;" aria-hidden="true">
|
||||
<input type="text" name="b_46d1ff41a9918b3b7efb885dc_6df88a3d0f" tabindex="-1" value="">
|
||||
</div>
|
||||
|
||||
<div class="flex overflow-hidden">
|
||||
<input type="email" value="" name="EMAIL" class="required email block w-full border border-gray p-3 pl-5 rounded-l-full" placeholder="enter your email" aria-label="Email">
|
||||
<button type="submit" name="subscribe" class="block w-auto border border-gray border-l-0 py-3 pl-5 pr-6 rounded-r-full bg-blue-600 text-white">Subscribe</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
10
source/_includes/tweet.html.twig
Normal file
10
source/_includes/tweet.html.twig
Normal file
|
@ -0,0 +1,10 @@
|
|||
<div class="my-4 flex justify-center {{ class }}">
|
||||
<blockquote
|
||||
class="twitter-tweet"
|
||||
lang="en"
|
||||
{% if not data_cards %}data-cards="hidden"{% endif %}
|
||||
{% if no_parent %}data-conversation="none"{% endif %}
|
||||
>
|
||||
{{ content|raw }}
|
||||
</blockquote>
|
||||
</div>
|
9
source/_includes/video-embed.html.twig
Normal file
9
source/_includes/video-embed.html.twig
Normal file
|
@ -0,0 +1,9 @@
|
|||
<div class="{{ classes }}">
|
||||
<iframe
|
||||
src="https://www.youtube.com/embed/{{ video.id }}"
|
||||
height="{{ video.attr.height }}"
|
||||
width="{{ video.attr.width }}"
|
||||
frameborder="0"
|
||||
allowfullscreen
|
||||
></iframe>
|
||||
</div>
|
Loading…
Add table
Add a link
Reference in a new issue