From 4ac1fcc6ee1112c9fda1e61afb7bf832284b14dd Mon Sep 17 00:00:00 2001 From: Carson Gross Date: Tue, 30 Aug 2022 14:57:11 -0600 Subject: [PATCH] fragments --- www/essays/template-fragments.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/www/essays/template-fragments.md b/www/essays/template-fragments.md index 1dee469a..75da2fa2 100644 --- a/www/essays/template-fragments.md +++ b/www/essays/template-fragments.md @@ -70,13 +70,15 @@ splitting the buttons out to their own template file and including it in this te #end ``` -Now we have two templates. This reduces the visibility of the archiving feature: it is less obvious what is going on -when you are looking just at the `detail.html` template. When pushed to extremes, decomposing templates like this can -lead to quite a few small template fragments which, in total, become difficult to reason about. +Now we have two templates. We can now render the `archive-ui.html` template separately, but this split reduces the +visibility of the archiving feature: it is less obvious what is going on when you are looking just at the `detail.html` +template. + +When pushed to extremes, decomposing templates like this can lead to quite a few small template fragments which, in +total, become difficult to reason about. ### Template Fragments To The Rescue - To address this issue, chill templates has a `#fragment` directive. This directive allows you to specify a block of content within a template and render _just that bit of content_: