Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rajasegar/cl-djula-tailwind
Tailwind classes for Djula templates
https://github.com/rajasegar/cl-djula-tailwind
common-lisp djula hacktoberfest hacktoberfest-accepted lisp tailwindcss
Last synced: 13 days ago
JSON representation
Tailwind classes for Djula templates
- Host: GitHub
- URL: https://github.com/rajasegar/cl-djula-tailwind
- Owner: rajasegar
- License: mit
- Created: 2022-08-06T10:38:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-03T07:22:27.000Z (about 2 years ago)
- Last Synced: 2024-10-04T17:30:46.165Z (about 1 month ago)
- Topics: common-lisp, djula, hacktoberfest, hacktoberfest-accepted, lisp, tailwindcss
- Language: Common Lisp
- Homepage:
- Size: 90.8 KB
- Stars: 9
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
* cl-djula-tailwind
[[https://github.com/rajasegar/cl-djula-tailwind/workflows/CI/badge.svg]]
[[http://quickdocs.org/badge/cl-djula-tailwind.svg]]
[[https://img.shields.io/badge/license-MIT-blue.svg]]
Use [[https://tailwindcss.com][TailwindCSS]] classe in your Djula templates without any JavaScript or Node.js tooling** Usage
Create a new [[https://github.com/fukamachi/caveman][Caveman]] project
#+begin_src lisp
(ql:quickload :caveman2)
(caveman2:make-project #P"~/quicklisp/local-projects/cl-tw-demo")
#+end_src- Add ~cl-djula-tailwind~ as system dependency
Add a placeholder for the stylesheet in the default template ~templates/layouts/default.html~#+BEGIN_SRC html
{{ tailwind | safe }}
#+END_SRCDefine a new function called ~render-stylesheet~ in ~src/web.lisp~
#+BEGIN_SRC lisp
(defun render-stylesheet (template)
(setf (getf djula:*default-template-arguments* :tailwind) (cl-djula-tailwind:get-stylesheet template *template-directory*)))
#+END_SRCCall this function in your routes with the template name as the argument
#+BEGIN_SRC lisp
(defroute "/" ()
(render-stylesheet #P"index.html")
(render #P"index.html"))
#+END_SRC** Installation
You can install it from quicklisp
#+BEGIN_SRC lisp
(ql:quickload :cl-djula-tailwind)#+END_SRC
** Author
+ Rajasegar Chandran
** Copyright
Copyright (c) 2022 Rajasegar Chandran