Move daily emails into the blog page

This commit is contained in:
Oliver Davies 2025-08-21 00:28:10 +01:00
parent be69398931
commit 1b8441608f
828 changed files with 9 additions and 196 deletions

View file

@ -1,7 +1,5 @@
---
sculpin_content_types:
daily_emails:
permalink: /daily/:year/:month/:day/:basename/
pages:
permalink: /:basename/
podcast_episodes:

View file

@ -1,20 +0,0 @@
{% extends 'page' %}
{% block meta_description %}{{ page.snippet|trim }}{% endblock %}
{% block content_wrapper %}
<time datetime="{{ page.date|date('Y-m-d') }}">{{ page.date|date('F jS, Y') }}</time>
{{ parent() }}
<p>- Oliver</p>
{% endblock %}
{% block content_bottom %}
{% include 'daily-email-form.html.twig' with {
intro: 'Sign up here and get more like this delivered straight to your inbox every day.',
title: 'Was this interesting?',
} %}
{% include 'about-me.html.twig' %}
{% endblock %}

View file

@ -1,48 +0,0 @@
---
layout: page
title: The Daily Drupaler
meta:
title: The Daily Drupaler - Daily Software Development Thoughts and Tips | %site.name%
description: |-
Daily Software Development Thoughts and Tips by %site.name%.
generator: pagination
pagination:
max_per_page: 30
provider: data.daily_emails
use:
- daily_emails
---
{% block content %}
{% set daily_emails = data.daily_emails|filter((email) => email.date <= 'now'|date) %}
<p>This is an archive of the {{ daily_emails|length|number_format }} email messages I have sent to <a href="/daily">my daily mailing list</a> since the 12th of August, 2022. Enjoy!</p>
<div class="mt-6 space-y-16">
<div>
<ul>
{% for email in page.pagination.items %}
<li>
<a href="{{ email.url }}">
{{ email.date|date('jS F Y') }}:
{{ email.title }}
</a>
</li>
{% endfor %}
</ul>
</div>
{% if page.pagination.previous_page or page.pagination.next_page %}
<nav class="flex justify-center pt-10 space-x-6">
{% if page.pagination.previous_page %}<a href="{{ site.url }}{{ page.pagination.previous_page.url }}">&larr; Newer Posts{% endif %}<br />
{% if page.pagination.next_page %}<a href="{{ site.url }}{{ page.pagination.next_page.url }}">Older Posts &rarr;</a>{% endif %}<br />
</nav>
{% endif %}
</div>
{% endblock %}
{% block content_bottom %}
{% include 'daily-email-form.html.twig' %}
{% include 'about-me.html.twig' %}
{% endblock %}

View file

@ -1,34 +0,0 @@
---
layout: page
title: Sign up for the Daily Drupaler Email List
meta:
title: The Daily Drupaler - Daily Software Development Thoughts and Tips | %site.name%
description: |-
Daily software development thoughts and tips by %site.name%.
use: [daily_emails]
---
{% block content %}
Subscribe to my daily newsletter for software professionals on software development and delivery, Drupal, DevOps, community, and open-source.
{% include 'daily-email-form.html.twig' %}
<section>
<h2>Still not sure?</h2>
<p>These are the emails I sent this week:</p>
<ul>
{% for email in data.daily_emails[:7] %}
<li><a href="{{ email.url }}">{{ email.title }}</a></li>
{% endfor %}
</ul>
</section>
{% endblock %}
{% block content_bottom %}
{% include 'testimonials.html.twig' with {
tag: 'daily',
title: 'What subscribers have said',
} %}
{% endblock %}

View file

@ -1,7 +1,6 @@
---
permalink: /sitemap.xml
use:
- daily_emails
- pages
- podcast_episodes
- posts

View file

@ -66,10 +66,6 @@ return Collection::make($stationNodes)
->map(fn (StationInterface $station): string => $station->getStationCode())
->values();
```
<<<<<<< HEAD:website/source/_daily_emails/2022-10-03.md
=======
>>>>>>> b9cea6d (chore: replace Sculpin with Astro):website/src/pages/daily-emails/2022-10-03.md
I've added an additional `map` to convert the nodes to the value object, but the second map can now use the new typehint - ensuring better type safety and also giving us auto-completion in IDEs and text editors. If an incorrect node type is passed in, then the Exception will be thrown and a much clearer error message will be shown.
Finally, I can use the helper method to get the field value, encapsulating the logic within the value object and making it intention clearer and easier to read.

Some files were not shown because too many files have changed in this diff Show more