Open eternal-turtles opened 1 month ago
asdf:load-system
, right? /static/
, or user supplied folder, such as /web/static/
in your example? If the user supplies custom folder we would need to make sure that the folder exists.favicon.ico
and copied version favorite-icon.ico
)? If yes, should the file type also be changeable?So it could look like this, whereas the first value is the path to the file to be copied and the second is the path where to copy the file:
:copy-file (list (list (pathname "/home/jnewton/web/static/favicon.ico") (pathname "/web/static/favorite-icon.ico")))
I should have mentioned, but this feature request is for when a custom cl-project:*skeleton-directory*
is provided before calling cl-project:make-project
(which allows for custom project skeletons).
asdf:load-system
. The idea is to copy images or other binary files from the custom skeleton directory to the equivalent location in the target directory.cl-project:make-project
to specify a static directory, or a special variable that names a static directory, with or without a default, is the way to go - I hadn't considered this approach, and think a default "static/" directory could make sense.I was imagining that there would be an additional special variable that might be checked around here https://github.com/fukamachi/cl-project/blob/0df6de16e98fc402d830b70d323f79d2df4791e6/src/io.lisp#L15-L18 and if the file pathname has a file-type that indicates it is binary, then it would be copied without calling cl-emb:execute-emb
. I do like the idea though of being able to specify a static directory or have a default static directory for which files would be copied without cl-emb processing. I'm not sure though about being able to specify different target filenames/locations for the copied static files, as I don't have a use-case for this and it wouldn't really be consistent with how cl-emb processed files are copied, always with the same name/relative location except with "skeleton" replaced with the project name.
@fukamachi Any thoughts on the right design for this feature if you agree with it and if you'd be open to a PR?
Edit: it now occurs to me that there might be JS or CSS files in the static directory that might be useful to process with cl-emb, so to me I think being able to specify binary file types, either with a special variable or an additional parameter to cl-project:make-project
, still makes the most sense.
It would be convenient to be able to specify some files from the skeleton to copy over without being processed by cl-emb.
I'd like to include favicon.ico or a png, or some other file that is not text-based, but currently an error like the following is signaled:
Perhaps there could be a second special variable that would be bound to a regular expression representing files to copy directly, or else a list of file extensions or filenames.
As a workaround, I can keep these files in another directory and copy them over after calling CL-PROJECT:MAKE-PROJECT, but this seems like a feature that could be added to the library.