Allow plugin render hooks to add link tags to the page (#1963)

Adds an extra optional property to plugin render results to allow
plugins to add `<link>` tags to the page.
This commit is contained in:
Adam Gregory
2023-11-08 23:51:14 +01:00
committed by GitHub
parent 1b767233f4
commit 14cecc0a6f
6 changed files with 52 additions and 2 deletions
@@ -0,0 +1,15 @@
import { Plugin } from "$fresh/server.ts";
export default {
name: "link-inject",
render(ctx) {
ctx.render();
return {
links: [{ rel: "stylesheet", href: "styles.css" }, {
rel: "stylesheet",
href: "print.css",
media: "print",
}],
};
},
} as Plugin;