File tree Expand file tree Collapse file tree 3 files changed +28
-16
lines changed
docs/building-blocks/static Expand file tree Collapse file tree 3 files changed +28
-16
lines changed Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ For example:
2020 of your :myproject system.
2121 Then reference static assets with the /static/ URL prefix."
2222 (push (hunchentoot:create-folder-dispatcher-and-handler
23- "/static/"
24- (merge-pathnames "src/static" ;; starts without a /
25- (asdf:system-source-directory :myproject))) ;; <- myproject
23+ "/static/"
24+ (asdf:system-relative-pathname :myproject "src/static/"))
25+ ;; ^^^ starts without a /
2626 hunchentoot:*dispatch-table*))
2727~~~
2828
@@ -33,8 +33,20 @@ and call it in the function that starts your application:
3333```
3434
3535Now our project's static files located under ` src/static/ ` are served
36- with the ` /static/ ` prefix, access them like this:
36+ with the ` /static/ ` prefix. Access them like this:
3737
3838``` html
3939<img src =" /static/img/banner.jpg" />
4040```
41+
42+ or
43+
44+ ``` html
45+ <script src =" /static/test.js" type =" text/javascript" ></script >
46+ ```
47+
48+ where the file ` src/static/test.js ` could be
49+
50+ ``` js
51+ console .log (" hello" );
52+ ```
You can’t perform that action at this time.
0 commit comments