-
Notifications
You must be signed in to change notification settings - Fork 664
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add initial plugin support (#512)
This commit adds initial support for fresh "plugins". These are bundles of functionality that can be added to a fresh plugin through a simple addition in the `main.ts` file. Right now plugins are only able to hook into the render steps. This means that they can inject styling and scripts. They can not yet hook into routing. Things that I think should be possible now: - styling integrations for twind, unocss, and probably a few other tools Things that are not possible yet: - google analytics middleware - database connectors - CMS connectors The routing additions to plugins can be added in a follow-up though.
- Loading branch information
1 parent
49092ed
commit fd4e2bb
Showing
20 changed files
with
410 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { template } from "./render.tsx"; | ||
import { assertStringIncludes } from "../../tests/deps.ts"; | ||
|
||
Deno.test("check lang", () => { | ||
const lang = "fr"; | ||
const body = template({ | ||
bodyHtml: "", | ||
headComponents: [], | ||
imports: [], | ||
preloads: [], | ||
styles: [], | ||
lang: lang, | ||
lang, | ||
}); | ||
assertStringIncludes(body, `<html lang="${lang}">`); | ||
}); |
Oops, something went wrong.