Closed piknik closed 3 years ago
From your description I'm not sure your file hierarchy is correct? The css file has to be in the static/
directory within your module directory. So it should be example/static/example.css
on disk.
From your description I'm not sure your file hierarchy is correct? The css file has to be in the
static/
directory within your module directory. So it should beexample/static/example.css
on disk.
Correct, the example.css is in ~/quicklisp/local-projects/radiance-test/static/example.css
.
Here is the ~/quicklisp/local-projects/radiance-test/radiance-test.lisp
file I'm using with variations on the uri-to-url
uri
parameter:
(in-package #:rad-user)
(define-module #:radiance-test
(:use #:cl #:radiance))
(in-package #:radiance-test)
(define-page example "/example" ()
(cl-who:with-html-output-to-string (o)
(cl-who:htm
(:html
(:head (:title "Example Page")
(:link :rel "stylesheet" :type "text/css"
:href (uri-to-url "/static/example.css" :representation :external)))
(:body (:header (:h1 "Couldn't Be Simpler."))
(:main (:p "Trust me on this one.")))))))
Also trying (uri-to-url "/static/example/example.css" :representation :external)
with the same result.
If it helps, I am using the following mostly generated .asd file too:
(in-package #:cl-user)
(asdf:defsystem #:radiance-test
:defsystem-depends-on (:radiance)
:class "radiance:virtual-module"
:components ((:file "radiance-test"))
:depends-on (:cl-who))
Also if it helps here is the radiance environment ~/.config/radiance/default/radiance-core/radiance-core.conf.lisp
. It has the welcome module removed from startup, and that's it (same issue with it on):
; meta (:version 1.0 :package "RADIANCE-CORE")
((:interfaces (:admin . "r-simple-admin") (:auth . "r-simple-auth")
(:ban . "r-simple-ban") (:cache . "r-simple-cache")
(:data-model . "r-simple-model") (:database . "i-lambdalite")
(:relational-database . "i-sqlite") (:logger . "i-verbose")
(:mail . "i-sendmail") (:profile . "r-simple-profile")
(:rate . "r-simple-rate") (:server . "i-hunchentoot")
(:session . "r-simple-sessions") (:user . "r-simple-users"))
(:versions
. [hash-table equal ("radiance-core" :|2.2.0|) ("i-verbose" :|1.0.0|)
("i-hunchentoot" :|1.1.0|) ("attridge-erp" :|0.0.2|) ("r-clip" :|1.0.0|)
("r-welcome" :|1.0.0|) ("r-simple-errors" :|1.0.0|)])
(:domains "radiance" "localhost" "127.0.0.1" "::1")
(:startup :r-simple-errors) (:routes) (:debugger . :if-swank-connected))
Well, I'm an idiot. Rather than use /static/example/example.css
I used /static/radiance-test/example.css
and it works.
Haha! Glad you managed to figure it out on your own. If you have problems in the future, don't hesitate to send another issue! :)
Hello,
I am beginning to use radiance and have attempted to follow the basics in getting started up. In my own code, I am unable to have radiance serve the static CSS files which exist in the same base directory as the project. I have tried to find out where I am going wrong in my own code.
However, I have then followed the instructions on the README step-by-step, creating a module (placed in ~/quicklisp/local-projects) and then using the code with cl-who and the provided CSS. At this point it is expected that radiance would serve the file provided by (uri-to-url "/static/example/example.css" :representation :external) but the following error was given instead:
Am I supposed to be running a local proxy web server like nginx or something? I'm missing something here. Perhaps some code changes were made in order to specify a static resource handler?