Completely type hint template functions and switch to named arguments

This commit is contained in:
Alex Cabal 2025-03-04 16:08:55 -06:00
parent 6108b5e53d
commit 124e8343fc
125 changed files with 542 additions and 450 deletions

View file

@ -2,7 +2,7 @@
$ebookIds = [1085, 1052];
$carousel = Db::Query('SELECT * from Ebooks where EbookId in ' . Db::CreateSetSql($ebookIds), $ebookIds, Ebook::class);
?>
<?= Template::Header(['title' => 'Death and Beauty in the Alps', 'css' => ['/css/blog.css'], 'highlight' => '', 'description' => '']) ?>
<?= Template::Header(title: 'Death and Beauty in the Alps', css: ['/css/blog.css']) ?>
<main>
<section class="narrow blog">
<nav class="breadcrumbs"><a href="/blog">Blog</a> </nav>
@ -31,7 +31,7 @@ $carousel = Db::Query('SELECT * from Ebooks where EbookId in ' . Db::CreateSetSq
<p><em>Scrambles Amongst the Alps</em> has something of both “darkling thrush” and “darkling plain”: an “eternal note of sadness” following terrible loss, but also real, if fleeting, notes of joy in laboring for, and realizing, a hope widely believed impossible.</p>
<p>The woe of its best-known story is confounded by lesser-known, brighter elements—even if theyre only “thin atomies” in comparison—praising the worth of the endeavour and the value of the toil it required, despite the cruel hand the explorers were dealt.</p>
<h2 id="ebooks-in-this-newsletter">Free ebooks in this post</h2>
<?= Template::EbookCarousel(['carousel' => $carousel]) ?>
<?= Template::EbookCarousel(carousel: $carousel) ?>
</section>
</main>
<?= Template::Footer() ?>

View file

@ -2,7 +2,7 @@
$ebookIds = [288, 485, 289, 908, 565, 2114];
$carousel = Db::Query('SELECT * from Ebooks where EbookId in ' . Db::CreateSetSql($ebookIds), $ebookIds, Ebook::class);
?>
<?= Template::Header(['title' => 'Edith Whartons Vision of Literary Art', 'css' => ['/css/blog.css'], 'highlight' => '', 'description' => '']) ?>
<?= Template::Header(title: 'Edith Whartons Vision of Literary Art', css: ['/css/blog.css']) ?>
<main>
<section class="narrow blog">
<nav class="breadcrumbs"><a href="/blog">Blog</a> </nav>
@ -33,7 +33,7 @@ $carousel = Db::Query('SELECT * from Ebooks where EbookId in ' . Db::CreateSetSq
<p><em>Hudson River Bracketed</em> is long out of print. Wharton patently lost the critical and commercial <em>Wettgesang</em> of the 1930s; even her sympathizers tend to admit that shes in no way a star of that period, so the analogy to the Prologue in Heaven falls (or sounds) very flat.</p>
<p>But whether Whartons second-last work falls entirely flat too is something that can be judged, if at all, only in the old way, by reading it. This wasnt very easy to do until January 1, but now you can read our <a href="https://standardebooks.org/ebooks/edith-wharton/hudson-river-bracketed">new ebook edition for free</a> at Standard Ebooks.</p>
<h2 id="ebooks-in-this-newsletter">Free ebooks in this post</h2>
<?= Template::EbookCarousel(['carousel' => $carousel]) ?>
<?= Template::EbookCarousel(carousel: $carousel) ?>
</section>
</main>
<?= Template::Footer() ?>

View file

@ -1,4 +1,4 @@
<?= Template::Header(['title' => 'Blog', 'highlight' => '', 'description' => 'The Standard Ebooks blog.']) ?>
<?= Template::Header(title: 'Blog', description: 'The Standard Ebooks blog.') ?>
<main>
<section class="narrow">
<h1>Blog</h1>

View file

@ -2,7 +2,7 @@
$ebookIds = [565, 778, 561, 1059];
$carousel = Db::Query('SELECT * from Ebooks where EbookId in ' . Db::CreateSetSql($ebookIds), $ebookIds, Ebook::class);
?>
<?= Template::Header(['title' => 'Joyces Ulysses, the Rubáiyát, and “Yes”', 'css' => ['/css/blog.css'], 'highlight' => '', 'description' => '']) ?>
<?= Template::Header(title: 'Joyces Ulysses, the Rubáiyát, and “Yes”', css: ['/css/blog.css']) ?>
<main>
<section class="narrow blog">
<nav class="breadcrumbs"><a href="/blog">Blog</a> </nav>
@ -44,7 +44,7 @@ $carousel = Db::Query('SELECT * from Ebooks where EbookId in ' . Db::CreateSetSq
<p>Speaking of consonance: Brown says, citing Ellmann, that the last record Joyce heard before he died was a performance of Lehmanns setting of Fitzgeralds Omar. As is often the case with Ellmann, this might not be true, but its not absurd to suppose that it could be.</p>
<p>And as very often with <i>Ulysses</i>, what first seems like nothing, or like material for a joke, may also turn out to be something else too, even something that matters. If <i>Ulysses</i> doesnt entirely affirm life, then it does, in this respect at least, reflect it.</p>
<h2 id="ebooks-in-this-newsletter">Free ebooks in this post</h2>
<?= Template::EbookCarousel(['carousel' => $carousel]) ?>
<?= Template::EbookCarousel(carousel: $carousel) ?>
</section>
</main>
<?= Template::Footer() ?>

View file

@ -100,7 +100,7 @@ foreach($ebooks as $ebook){
ksort($ebooksWithDescriptions);
?><?= Template::Header(['title' => 'Public Domain Day 2025 in Literature - Blog', 'highlight' => '', 'description' => 'Read about the new ebooks Standard Ebooks is releasing for Public Domain Day 2025!', 'css' => ['/css/public-domain-day.css']]) ?>
?><?= Template::Header(title: 'Public Domain Day 2025 in Literature - Blog', description: 'Read about the new ebooks Standard Ebooks is releasing for Public Domain Day 2025!', css: ['/css/public-domain-day.css']) ?>
<main>
<section class="narrow blog has-hero">
<nav class="breadcrumbs"><a href="/blog">Blog</a> </nav>
@ -133,7 +133,7 @@ ksort($ebooksWithDescriptions);
<li>
<div>
<a href="<?= $ebookGroup['ebook']->Url ?>">
<?= Template::RealisticEbook(['ebook' => $ebookGroup['ebook']]) ?>
<?= Template::RealisticEbook(ebook: $ebookGroup['ebook']) ?>
</a>
</div>
<div>