Skip to content

Commit 8e558d3

Browse files
committed
start on template inheritance structure
1 parent 94298f1 commit 8e558d3

9 files changed

Lines changed: 88 additions & 60 deletions

posts/2017-09-07-introducing-command-handler.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ <h1 class="title">Cosmic Python</h1>
2424
</nav>
2525

2626
<section class="container">
27-
<h1> Introducing Command Handler</h1>
28-
<p>by Bob, </p>
27+
28+
<h1> Introducing Command Handler</h1>
29+
<p>by Bob, </p>
2930

30-
<div class="content">
31-
<p>The term DDD comes from the book by Eric Evans: <a href="[https://www.amazon.co.uk/Domain-driven-Design-Tackling-Complexity-Software/dp/0321125215">&ldquo;Domain-Driven Design: Tackling
31+
<div class="content">
32+
<p>The term DDD comes from the book by Eric Evans: <a href="[https://www.amazon.co.uk/Domain-driven-Design-Tackling-Complexity-Software/dp/0321125215">&ldquo;Domain-Driven Design: Tackling
3233
Complexity in the Heart of Software&rdquo;</a>.
3334
In his book he describes a set of practices that aim to help us build
3435
maintainable, rich, software systems that solve customer&rsquo;s problems. The book is
@@ -355,7 +356,9 @@ <h1> Introducing Command Handler</h1>
355356
we&rsquo;ll lose all of our data every time we restart the process. We&rsquo;ll fix the
356357
second of those in the next part
357358
[https://io.made.com/blog/repository-and-unit-of-work-pattern-in-python/].</p>
358-
</div>
359+
</div>
360+
</section>
361+
359362
</section>
360363
</main>
361364
</body>

posts/2017-09-08-repository-and-unit-of-work-pattern-in-python.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ <h1 class="title">Cosmic Python</h1>
2424
</nav>
2525

2626
<section class="container">
27-
<h1> Repository and Unit of Work Pattern</h1>
28-
<p>by Bob, </p>
27+
28+
<h1> Repository and Unit of Work Pattern</h1>
29+
<p>by Bob, </p>
2930

30-
<div class="content">
31-
<hr>
31+
<div class="content">
32+
<hr>
3233
<p>In the previous part
3334
(<a href="{% post_url 2017-09-07-introducing-command-handler %}">Introducing Command Handler</a>)
3435
of this series we built a toy system that could add a new Issue to an IssueLog, but
@@ -301,7 +302,9 @@ <h1> Repository and Unit of Work Pattern</h1>
301302

302303
<p>Next time [https://io.made.com/blog/commands-and-queries-handlers-and-views]
303304
we&rsquo;ll look at how to get data back out of the system.</p>
304-
</div>
305+
</div>
306+
</section>
307+
305308
</section>
306309
</main>
307310
</body>

posts/2017-09-13-commands-and-queries-handlers-and-views.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ <h1 class="title">Cosmic Python</h1>
2424
</nav>
2525

2626
<section class="container">
27-
<h1> Commands, Handlers, Queries and Views</h1>
28-
<p>by Bob, </p>
27+
28+
<h1> Commands, Handlers, Queries and Views</h1>
29+
<p>by Bob, </p>
2930

30-
<div class="content">
31-
<hr>
31+
<div class="content">
32+
<hr>
3233
<p>In the first and second parts of this series I introduced the
3334
<a href="{% post_url 2017-09-07-introducing-command-handler %}">Command-Handler</a>
3435
and
@@ -304,7 +305,9 @@ <h3>Application Controlled Identifiers</h3>
304305
drive our application from tests or Flask. Most importantly, the layers on the
305306
outside depend on the layers toward the centre.</p>
306307
<p>Next time I&rsquo;ll get back to talking about message buses.</p>
307-
</div>
308+
</div>
309+
</section>
310+
308311
</section>
309312
</main>
310313
</body>

posts/2017-09-19-why-use-domain-events.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ <h1 class="title">Cosmic Python</h1>
2424
</nav>
2525

2626
<section class="container">
27-
<h1> Why use domain events?</h1>
28-
<p>by Bob, </p>
27+
28+
<h1> Why use domain events?</h1>
29+
<p>by Bob, </p>
2930

30-
<div class="content">
31-
<hr>
31+
<div class="content">
32+
<hr>
3233
<p>Nota bene: this instalment in the Ports and Adapters with Command Handlers
3334
series is code-heavy, and isn&rsquo;t going to make much sense unless you&rsquo;ve read the
3435
previous parts:</p>
@@ -501,7 +502,9 @@ <h1>Example usage</h1>
501502
the system are equal, glue code is just glue.</p>
502503
<p>Next time I want to talk about Dependency Injection, why it&rsquo;s great, and why
503504
it&rsquo;s nothing to be afraid of.</p>
504-
</div>
505+
</div>
506+
</section>
507+
505508
</section>
506509
</main>
507510
</body>

posts/2020-01-25-testing_external_api_calls.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ <h1 class="title">Cosmic Python</h1>
2424
</nav>
2525

2626
<section class="container">
27-
<h1> Writing tests for external API calls</h1>
28-
<p>by Harry, </p>
27+
28+
<h1> Writing tests for external API calls</h1>
29+
<p>by Harry, </p>
2930

30-
<div class="content">
31-
<hr>
31+
<div class="content">
32+
<hr>
3233
<p>Here&rsquo;s a common question from people doing testing in Python:</p>
3334
<blockquote>
3435
<p>How do I write tests for for code that calls out to a third-party API?</p>
@@ -727,7 +728,9 @@ <h2>Prior art</h2>
727728
<li><a href="https://pythonspeed.com/articles/verified-fakes/">Verified fakes</a> by Itamar Turner-Trauring</li>
728729
<li><a href="https://www.youtube.com/watch?v=PBQN62oUnN8">Hoist your I/O</a> by Brandon Rhodes</li>
729730
</ul>
730-
</div>
731+
</div>
732+
</section>
733+
731734
</section>
732735
</main>
733736
</body>

rss.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Simple patterns for building complex apps
88
</description>
99
<link>https://cosmicpython.com</link>
10-
<lastBuildDate>Sun, 15 Mar 2020 18:58:55 -0000</lastBuildDate>
10+
<lastBuildDate>Sun, 15 Mar 2020 19:41:45 -0000</lastBuildDate>
1111
<pubDate>Sat, 4 Jan 2020 19:15:54 -0500</pubDate>
1212
<atom:link href="https://cosmicpython.com/rss.xml" rel="self" type="application/rss+xml" />
1313

templates/base.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<meta name="author" content="Harry Percival and Bob Gregory">
8+
<meta name="description" content="">
9+
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
10+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.css">
11+
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.css">
12+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pygments-css@1.0.0/friendly.css">
13+
</head>
14+
15+
<body>
16+
<main class="wrapper">
17+
18+
<nav class="navigation">
19+
<section class="container">
20+
<a class="navigation-title" href="https://cosmicpython.com">
21+
<h1 class="title">Cosmic Python</h1>
22+
</a>
23+
</section>
24+
</nav>
25+
26+
<section class="container">
27+
{% block content_block %}
28+
{% endblock %}
29+
</section>
30+
</main>
31+
</body>
32+
</html>

templates/blog_post_template.html

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,11 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
1+
{% extends "templates/base.html" %}
32

4-
<head>
5-
<meta charset="utf-8">
6-
<meta name="viewport" content="width=device-width, initial-scale=1">
7-
<meta name="author" content="Harry Percival and Bob Gregory">
8-
<meta name="description" content="">
9-
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic">
10-
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.css">
11-
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.css">
12-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pygments-css@1.0.0/friendly.css">
13-
</head>
3+
{% block content_block %}
4+
<h1> {{ blog_heading[0] }}</h1>
5+
<p>by {{blog_author[0]}}, {{blog_publish_date[0]}}</p>
146

15-
<body>
16-
<main class="wrapper">
17-
18-
<nav class="navigation">
19-
<section class="container">
20-
<a class="navigation-title" href="https://cosmicpython.com">
21-
<h1 class="title">Cosmic Python</h1>
22-
</a>
23-
</section>
24-
</nav>
25-
26-
<section class="container">
27-
<h1> {{ blog_heading[0] }}</h1>
28-
<p>by {{blog_author[0]}}, {{blog_publish_date[0]}}</p>
29-
30-
<div class="content">
31-
{{content}}
32-
</div>
33-
</section>
34-
</main>
35-
</body>
36-
</html>
7+
<div class="content">
8+
{{content}}
9+
</div>
10+
</section>
11+
{% endblock %}

templates/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% extends "templates/base.html" %}
2+
3+
{% block content_block %}
4+
{{ content }}
5+
{% endblock %}
6+

0 commit comments

Comments
 (0)