-
-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(builder)!: improve builder by using
CSSStyleSheet()
, add remai…
…ning variables and a custom build previewer (#31)
- Loading branch information
1 parent
0bbda0b
commit 3accc03
Showing
9 changed files
with
623 additions
and
272 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
import { copy, emptyDir, ensureDir, expandGlob } from "jsr:@std/[email protected]" | ||
import { dirname, fromFileUrl } from "jsr:@std/[email protected]" | ||
import { root } from "./root.ts" | ||
import { html, html_builder } from "./html.ts" | ||
import { html, html_builder, html_builder_demo } from "./html.ts" | ||
import { compatibility } from "jsr:@libs/bundle@5/css" | ||
|
||
/** Static site generation */ | ||
|
@@ -34,6 +34,9 @@ export async function ssg() { | |
console.log("Created .pages/index.html") | ||
await Deno.writeTextFile(new URL(".pages/build.html", root), await html_builder()) | ||
console.log("Created .pages/build.html") | ||
await ensureDir(new URL(".pages/build", root)) | ||
await Deno.writeTextFile(new URL(".pages/build/demo.html", root), await html_builder_demo()) | ||
console.log("Created .pages/build/demo.html") | ||
// Copy styles | ||
await ensureDir(new URL(".pages/styles", root)) | ||
console.log("Created .pages/styles") | ||
|
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,7 +1,7 @@ | ||
/// <reference lib="dom" /> | ||
// Imports | ||
import { css } from "./build/css.ts" | ||
import { html, html_builder } from "./build/html.ts" | ||
import { html, html_builder, html_builder_demo } from "./build/html.ts" | ||
import { ssg } from "./build/ssg.ts" | ||
import { dist } from "./build/dist.ts" | ||
import { STATUS_CODE, STATUS_TEXT } from "jsr:@std/[email protected]" | ||
|
@@ -22,6 +22,8 @@ switch (Deno.args[0]) { | |
return new Response(await html_builder(), { headers: { "Content-Type": "text/html" } }) | ||
case new URLPattern("/matcha.css", url.origin).test(url.href): | ||
return new Response(await css(), { headers: { "Content-Type": "text/css" } }) | ||
case new URLPattern("/build/demo{.html}?", url.origin).test(url.href): | ||
return new Response(await html_builder_demo(), { headers: { "Content-Type": "text/html" } }) | ||
case new URLPattern("/mod.css", url.origin).test(url.href): | ||
return new Response(await Deno.readFile(new URL("mod.css", import.meta.url)), { headers: { "Content-Type": "text/css" } }) | ||
case new URLPattern("/mod.svg", url.origin).test(url.href): | ||
|
Oops, something went wrong.