Skip to content

Commit 0899d36

Browse files
committed
update docs
1 parent 6fc667a commit 0899d36

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

nbs/ref/handlers.ipynb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,10 @@
594594
"\n",
595595
"The `link` parameter in FT components sets the `href` attribute of the rendered HTML element. By using `uri()`, we can dynamically generate correct URLs even if the underlying route structure changes.\n",
596596
"\n",
597+
"FastHTML provides several shorthand attributes that enable URL resolution: `link`= (becomes `href`=), `get`= (becomes `hx-get`=), `post`= (becomes `hx-post`=), `put`=, `delete`=, and `patch`=. These shorthands are required for `uri()` resolution to work at render time.\n",
598+
"\n",
599+
"Important: Using `hx_get=uri(...)` directly will not resolve the URL - you must use the shorthand `get=uri(...)` instead.\n",
600+
"\n",
597601
"This approach promotes maintainable code by centralizing route definitions and avoiding hardcoded URLs throughout the application."
598602
]
599603
},
@@ -2135,13 +2139,7 @@
21352139
]
21362140
}
21372141
],
2138-
"metadata": {
2139-
"kernelspec": {
2140-
"display_name": "python3",
2141-
"language": "python",
2142-
"name": "python3"
2143-
}
2144-
},
2142+
"metadata": {},
21452143
"nbformat": 4,
21462144
"nbformat_minor": 5
21472145
}

0 commit comments

Comments
 (0)