Patrick Hein
2bc30bb780
templates: Implement placeholders function ( #3324 )
* caddyhttp, httpcaddyfile: Implement placeholders in template
* caddyhttp, httpcaddyfile: Remove support for placeholder shorthands in templates
* Update modules/caddyhttp/templates/templates.go
updates JSON doc
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
* Update modules/caddyhttp/templates/tplcontext.go
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
5 years ago
Greg Anders
c35820012b
templates: Disable hard wraps in Markdown rendering ( #3553 )
5 years ago
Matthew Holt
9770ce7c9f
Minor comment fix
5 years ago
Matthew Holt
b1ce9d4db7
templates: Add env function ( closes #3237 )
5 years ago
Matthew Holt
437d5095a6
templates: Use text/template; add experimental notice to docs
Using html/template.HTML like we were doing before caused nested include
to be HTML-escaped, which breaks sites. Now we do not escape any of the
output; template input is usually trusted, and if it's not, users should
employ escaping actions within their templates to keep it safe. The docs
already said this.
5 years ago
Matthew Holt
406df22a16
templates: Enable Goldmark's footnote extension ( closes #3136 )
Also remove Table extension, since GFM (already enabled) apparently
enables strikethrough, table, linkify, and tasklist extensions.
https://github.com/yuin/goldmark#built-in-extensions
5 years ago
Matthew Holt
82bebfab8a
templates: Change functions, add front matter support, better markdown
5 years ago
Matthew Holt
a458544d9f
Minor enhancements/fixes to rewrite directive and template virt req's
5 years ago
Matthew Holt
abf5ab340e
caddyhttp: Improve ResponseRecorder to buffer headers
5 years ago
Matthew Holt
715e6ddf51
go.mod: Update dependencies
5 years ago
Matthew Holt
ab885f07b8
Implement config adapters and beginning of Caddyfile adapter
Along with several other changes, such as renaming caddyhttp.ServerRoute
to caddyhttp.Route, exporting some types that were not exported before,
and tweaking the caddytls TLS values to be more consistent.
Notably, we also now disable automatic cert management for names which
already have a cert (manually) loaded into the cache. These names no
longer need to be specified in the "skip_certificates" field of the
automatic HTTPS config, because they will be skipped automatically.
6 years ago
Matthew Holt
f217181293
mod: Use blackfriday's standard v2 module import path
6 years ago
Matthew Holt
fdd871e177
go.mod: Append /v2 to module name; update all import paths
See https://github.com/golang/go/wiki/Modules#semantic-import-versioning
6 years ago
Matthew Holt
3177ee8010
Add license
6 years ago
Matthew Holt
006dc1792f
Use html/template for escaping by default
Allow HTML only with a few specific functions
6 years ago
Matthew Holt
81a9e125b5
Oops
6 years ago
Matthew Holt
70c788ce0c
Minor cleanups/improvements
6 years ago
Matthew Holt
15647bdfb7
templates: Remove context functions implemented by sprig
6 years ago
Matthew Holt
2663dd176d
Refactor templates execution; add sprig functions
6 years ago
Matthew Holt
6706c9225a
Implement templates handler; various minor cleanups and bug fixes
6 years ago