feat: allow plugins to modify HTML body (#2022)
Based on https://github.com/denoland/fresh/pull/1769 . Mostly added a test. --------- Co-authored-by: Adam Gregory <adam@aguilaengineering.com>
This commit is contained in:
co-authored by
Adam Gregory
parent
14cecc0a6f
commit
7ff2781fcd
@@ -80,7 +80,9 @@ client.
|
||||
The `render` hook needs to synchronously return a
|
||||
[`PluginRenderResult`](https://deno.land/x/fresh/server.ts?s=PluginRenderResult)
|
||||
object. Additional CSS and JS modules can be added to be injected into the page
|
||||
by adding them to `styles`, `links` and `scripts` arrays in this object.
|
||||
by adding them to `styles`, `links` and `scripts` arrays in this object. The
|
||||
plugin can also replace the the HTML in side the `<body>`-element of the page by
|
||||
including a `htmlText` string in this object.
|
||||
|
||||
`styles` are injected into the `<head>` of the page as inline CSS. Each entry
|
||||
can define the CSS text to inject, as well as an optional `id` for the style
|
||||
|
||||
Reference in New Issue
Block a user