mirror of
https://github.com/caddyserver/website.git
synced 2025-04-21 20:46:15 -04:00
docs: Several minor tweaks and fixes
This commit is contained in:
parent
a80f20b385
commit
cca0660339
7 changed files with 46 additions and 38 deletions
|
@ -77,6 +77,8 @@ 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:
|
||||
|
||||
<!-- We use zero-width space character () to trick templates into not evaluating in this tutorial. -->
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
@ -84,7 +86,7 @@ Let's do something interesting with our file server: serve a templated page. Cre
|
|||
<title>Caddy tutorial</title>
|
||||
</head>
|
||||
<body>
|
||||
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"}}
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
@ -94,7 +96,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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue