-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
bug 🐞Something isn't workingSomething isn't working
Description
First off thanks for this wonderful piece of software. Caddy is great.
Problem Description
I use caddy for some pretty complex markdown templating with nested includes. With caddy 2.4.5 everything was fine but with the latest version 2.4.6 rendering templates seems pretty inconsistent. Caddy renders different pages between page reloads. Sometimes the result looks good, sometimes the markdown file is put plain as it is into the final html leading to something like this:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
---
title: My Title
tags:
- tag1
- tag2
- tag3
---
# What a wonderful heading
And a lot of text...
<h1><p>My Title</p>
</h1>
<h1 id="what-a-wonderful-heading">What a wonderful heading</h1>
<p>And a lot of text...</p>
</body>
</html>Here is a simple version of my setup
Caddyfile
:7777 {
file_server
templates
}
index.html
<!DOCTYPE html>
<html>
<head>
</head>
<body>
{{include "incl.html"}}
</body>
</html>incl.html
{{$content := "markdown.md"}}
{{$p := include $content | splitFrontMatter}}
<h1>{{markdown $p.Meta.title}}</h1>
{{markdown $p.Body}}
markdown.md
---
title: My Title
tags:
- tag1
- tag2
- tag3
---
# What a wonderful heading
And a lot of text...How to reproduce
Try loading the page several times (i.e. curl http://localhost:7777) and look into what you get. The different versions of output seem to be pretty evenly distributed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug 🐞Something isn't workingSomething isn't working