如何配置project.clj文件以配置它在编译时输出hiccup & garden的html & css文件,这样我就可以部署到服务器而不需要在客户端加载任何动态css/html文件?
发布于 2017-07-08 05:11:01
如果你真的不需要使用Leiningen,使用Boot你可以很容易地使用perun.io,特别是当网站是主要目标的时候:
https://perun.io/guides/getting-started/
https://github.com/hashobject/perun。
我用https://github.com/ArchieT/website-archiet的方式重写了我的网站。
如果需要使用Lein,也许我会在以后再考虑,因为我现在没有太多时间。
这应该不难做到。
发布于 2020-01-22 20:50:59
您可以使用lein-garden leiningen插件:https://github.com/noprompt/lein-garden。
这是一个示例配置。
(defproject cash-money "1.1.1"
:plugins [[lein-garden "X.X.X"]]
:garden {:builds [{;; Optional name of the build:
:id "screen"
;; Source paths where the stylesheet source code is
:source-paths ["src/styles"]
;; The var containing your stylesheet:
:stylesheet cash-money.core/screen
;; Compiler flags passed to `garden.core/css`:
:compiler {;; Where to save the file:
:output-to "resources/screen.css"
;; Compress the output?
:pretty-print? false}}]})然后,您可以运行lein garden auto来监视更改并自动重新编译。
如果您想要一个使用以下代码的代码库示例:https://github.com/Dexterminator/spotify-data-extrapolator/tree/db8d6e16529940272409598c8ac0fdbbaf739646
为了帮助你在将来找到这样的东西,我将描述一个发现的过程。
我是通过访问garden github存储库(https://github.com/noprompt/garden)并在代码中查找一些看起来是garden独有的文本来发现这一点的,这样我就可以搜索所有的github并找到其他使用garden的存储库。我选择的这段文本是defpseudoelement。我浏览了已经在使用garden的项目,在自述文件中找到了一个提到运行lein garden auto的项目。再次搜索lein garden auto后,我找到了lein-garden leiningen插件。事后看来,看看garden的作者还写了哪些其他库可能更有意义。这样我们就可以直接找到插件了。这就是生活。
https://stackoverflow.com/questions/41053509
复制相似问题