From 167fe7079f1db1cc7853403bcf9b1363ce9332c8 Mon Sep 17 00:00:00 2001 From: Francis Lavoie Date: Wed, 15 Apr 2020 14:03:02 -0400 Subject: [PATCH] docs: Fix incorrectly escaped template example (#27) --- src/docs/markdown/caddyfile-tutorial.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/docs/markdown/caddyfile-tutorial.md b/src/docs/markdown/caddyfile-tutorial.md index 069ea0c..8d65ed3 100644 --- a/src/docs/markdown/caddyfile-tutorial.md +++ b/src/docs/markdown/caddyfile-tutorial.md @@ -77,8 +77,6 @@ Save your Caddyfile, then refresh your browser tab. You should either see a list Let's do something interesting with our file server: serve a templated page. Create a new file and paste this into it: - - ```html @@ -86,7 +84,7 @@ Let's do something interesting with our file server: serve a templated page. Cre Caddy tutorial - Page loaded at: {​{now | date "Mon Jan 2 15:04:05 MST 2006"}​} + Page loaded at: {{`{{`}}now | date "Mon Jan 2 15:04:05 MST 2006"{{`}}`}} ``` @@ -96,7 +94,7 @@ Save this as `caddy.html` in the current directory and load it in your browser: The output is: ``` -Page loaded at: {​{now | date "Mon Jan 2 15:04:05 MST 2006"}​} +Page loaded at: {{`{{`}}now | date "Mon Jan 2 15:04:05 MST 2006"{{`}}`}} ``` Wait a minute. We should see today's date. Why didn't it work? It's because the server hasn't yet been configured to evaluate templates! Easy to fix, just add a line to the Caddyfile so it looks like this: