diff --git a/qlfile b/qlfile index b64cfa2..428486e 100644 --- a/qlfile +++ b/qlfile @@ -7,4 +7,5 @@ ql cl-ppcre ql log4cl ql function-cache ql trivial-backtrace -ql cl-interpol +ql parenscript +ql paren6 diff --git a/qlfile.lock b/qlfile.lock index 10871ee..aa1b3f2 100644 --- a/qlfile.lock +++ b/qlfile.lock @@ -38,7 +38,11 @@ (:class qlot/source/ql:source-ql :initargs (:%version :latest) :version "ql-2023-10-21")) -("cl-interpol" . +("parenscript" . + (:class qlot/source/ql:source-ql + :initargs (:%version :latest) + :version "ql-2023-10-21")) +("paren6" . (:class qlot/source/ql:source-ql :initargs (:%version :latest) :version "ql-2023-10-21")) diff --git a/src/components/layout.lisp b/src/components/layout.lisp index 4be4ce7..4b00d90 100644 --- a/src/components/layout.lisp +++ b/src/components/layout.lisp @@ -1,7 +1,8 @@ -(defpackage #:hp/components/layout - (:use #:cl - #:piccolo - #:cl-interpol) +(uiop:define-package #:hp/components/layout + (:use #:cl) + (:mix #:parenscript + #:paren6 + #:piccolo) (:import-from #:hp/config/asset #:*hx-ext*) (:import-from #:hp/view/asset @@ -9,18 +10,16 @@ (:export #:layout)) (in-package #:hp/components/layout) -(named-readtables:in-readtable :interpol-syntax) - (defparameter *header-nav-items* - '((:href "/" :label "Home") - (:href "/about" :label "About") - (:href "/work" :label "Work"))) + '((:href "/" :label "Home") + (:href "/about" :label "About") + (:href "/work" :label "Work"))) (define-element header-nav-item (href label) (li :class "px-4 rounded-full" - :|:class| #?"isCurrentPath('${href}') - && 'font-bold bg-indigo-200 pointer-events-none shadow-sm'" + :|:class| (ps* `(and (is-current-path ,href) + "font-bold bg-indigo-200 pointer-events-none shadow-sm")) (a :href href label))) @@ -29,12 +28,10 @@ (h1 :class "font-bold text-xl" "skyizwhite.dev") (nav - :x-data "{ - currentPath: window.location.pathname, - isCurrentPath(path) { - return this.currentPath === path - } - }" + :x-data (ps (create6 + (current-path (@ window location pathname)) + (defun is-current-path (path) + (eql (@ this current-path) path)))) :hx-boost "true" (ul :class "h-full flex items-center gap-6 text-lg" (mapcar (lambda (item) (header-nav-item item)) diff --git a/src/routes/index.lisp b/src/routes/index.lisp index 8215dad..8670b45 100644 --- a/src/routes/index.lisp +++ b/src/routes/index.lisp @@ -1,15 +1,14 @@ -(defpackage #:hp/routes/index - (:use #:cl - #:piccolo - #:cl-interpol) +(uiop:define-package #:hp/routes/index + (:use #:cl) + (:mix #:parenscript + #:paren6 + #:piccolo) (:import-from #:hp/view/* #:defasset #:render) (:export #:handle-get)) (in-package #:hp/routes/index) -(named-readtables:in-readtable :interpol-syntax) - (defasset *me-img* :img "me.jpg") (define-element page () @@ -24,11 +23,7 @@ (h1 :class "text-4xl font-bold" "paku (skyizwhite)") (p :class "text-xl" - "Web developer" - (br) - "Admin of" - (a :target "_blank" :href "https://himagine.club" :class "text-indigo-500" - "himagine.club")) + "Software developer") (ul (li (span "GitHub:") @@ -39,12 +34,14 @@ "@skyizwhite")) (li (span "Email: ") - (let ((email "'paku'+'@'+'skyizwhite.dev'")) - (a - :x-data t - :x-text email - :|:href| #?"'mailto:'+${email}" - :class "text-indigo-500"))) + (a + :x-data (ps (create6 + (email (list6 "paku" "@" "skyizwhite.dev")) + (mailto (list6 "mailto:")))) + :x-text (ps (chain email (join ""))) + :|:href| (ps (chain (list6 :... mailto :... email) (join ""))) + :|:class| "'text-indigo-500'" + "Please enable Javascript to read.")) (li (span "Fediverse(main): ") (a