Skip to content

Commit cd6b082

Browse files
committed
fix: rename const to avoid collision when sourced from www/serve.nu
1 parent e4d58cc commit cd6b082

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

changes/v0.14.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
- **Datastar 1.0 alignment (breaking)**: `from datastar-signals` now reads DELETE signals from query params (matching the updated [SDK ADR](https://github.com/starfederation/datastar/pull/1146)). If you use Datastar with DELETE requests, no code changes needed -- it just works correctly now.
1414

15-
- **New examples**: A [blog example](https://github.com/cablehead/http-nu/tree/main/examples/blog) showing routing, layouts, and HTML composition, plus a reworked [stor example](https://github.com/cablehead/http-nu/tree/main/examples) that demonstrates in-memory SQLite by logging its own page views.
15+
- **New examples**: A [blog example](https://http-nu.cross.stream/examples/blog/) showing routing, layouts, and HTML composition, plus a reworked [stor example](https://http-nu.cross.stream/examples/stor/) that demonstrates in-memory SQLite by logging its own page views.
1616

1717
- **`href` for mount-aware links**: When your handler is mounted under a prefix (e.g. `/blog`), `$req | href "/about"` produces `/blog/about`. No more manually threading prefixes through your templates.
1818

examples/templates/serve.nu

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
const script_dir = path self | path dirname
1+
const templates_dir = path self | path dirname
22

33
# Seed store topics from disk files when --store is enabled
44
if $HTTP_NU.store != null {
5-
open ($script_dir | path join topics/page.html) | .append page.html
6-
open ($script_dir | path join topics/base.html) | .append base.html
7-
open ($script_dir | path join topics/nav.html) | .append nav.html
5+
open ($templates_dir | path join topics/page.html) | .append page.html
6+
open ($templates_dir | path join topics/base.html) | .append base.html
7+
open ($templates_dir | path join topics/nav.html) | .append nav.html
88
}
99
1010
{|req|
1111
match $req.path {
12-
"/file" => { {name: "World"} | .mj ($script_dir | path join page.html) }
12+
"/file" => { {name: "World"} | .mj ($templates_dir | path join page.html) }
1313
"/topic" => { {name: "World"} | .mj --topic "page.html" }
1414
_ => {
1515
{} | .mj --inline '<h1>Templates</h1>

0 commit comments

Comments
 (0)