Delete assets
This commit is contained in:
parent
ee637da21c
commit
1d5a6c1d8a
21 changed files with 16 additions and 423 deletions
src/components
|
@ -1,41 +1,14 @@
|
|||
(defpackage #:hp/components/document
|
||||
(:use #:cl
|
||||
#:hsx)
|
||||
(:import-from #:hp/view/asset
|
||||
#:defasset)
|
||||
(:export #:document))
|
||||
(in-package #:hp/components/document)
|
||||
|
||||
(defasset *htmx* :vendor "htmx@1.9.12.js")
|
||||
(defasset *htmx-exts* :htmx-ext
|
||||
("alpine-morph@1.9.12.js"
|
||||
"head-support@1.9.12.js"))
|
||||
|
||||
(defasset *alpine* :vendor "alpine@3.13.8.js")
|
||||
(defasset *alpine-exts* :alpine-ext
|
||||
("morph@3.13.8.js"
|
||||
"persist@3.13.8.js"))
|
||||
(defasset *alpine-store* :root "store.js")
|
||||
|
||||
(defasset *global-css* :root "global.css")
|
||||
(defasset *dist-css* :root "dist.css")
|
||||
|
||||
(defcomp document (&key title description children)
|
||||
(hsx
|
||||
(html :lang "ja"
|
||||
(head
|
||||
(meta :charset "UTF-8")
|
||||
(script :src *htmx*)
|
||||
(mapcar (lambda (path) (script :src path))
|
||||
*htmx-exts*)
|
||||
(mapcar (lambda (path) (script :src path :defer t))
|
||||
*alpine-exts*)
|
||||
(script :src *alpine-store* :defer t)
|
||||
(script :src *alpine* :defer t)
|
||||
(style
|
||||
"@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&display=swap');")
|
||||
(link :rel "stylesheet" :type "text/css" :href *global-css*)
|
||||
(link :rel "stylesheet" :type "text/css" :href *dist-css*)
|
||||
(title (format nil "~@[~a - ~]skyizwhite.dev" title))
|
||||
(meta
|
||||
:name "description"
|
||||
|
|
|
@ -1,51 +1,13 @@
|
|||
(uiop:define-package #:hp/components/layout
|
||||
(:use #:cl)
|
||||
(:mix #:parenscript
|
||||
#:paren6
|
||||
(:use #:cl
|
||||
#:hsx)
|
||||
(:import-from #:hp/config/asset
|
||||
#:*hx-ext*)
|
||||
(:import-from #:hp/view/asset
|
||||
#:defasset)
|
||||
(:export #:layout))
|
||||
(in-package #:hp/components/layout)
|
||||
|
||||
(defparameter *header-nav-items*
|
||||
'((:href "/" :label "Home")
|
||||
(:href "/about" :label "About")
|
||||
(:href "/work" :label "Work")))
|
||||
|
||||
(defcomp header-nav-item (&key href label)
|
||||
(hsx
|
||||
(li
|
||||
:class "px-4 rounded-full"
|
||||
:|:class| (ps* `(and (is-current-path ,href)
|
||||
"font-bold bg-indigo-200 pointer-events-none shadow-sm"))
|
||||
(a :href href
|
||||
label))))
|
||||
|
||||
(defcomp layout-header ()
|
||||
(hsx
|
||||
(header :class "px-10 py-6 flex justify-between"
|
||||
(h1 :class "font-bold text-xl"
|
||||
"skyizwhite.dev")
|
||||
(nav
|
||||
: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))
|
||||
*header-nav-items*))))))
|
||||
|
||||
(defcomp layout (&key children)
|
||||
(hsx
|
||||
(body
|
||||
:hx-ext *hx-ext*
|
||||
:class "h-[100svh] flex flex-col bg-neutral-200"
|
||||
(layout-header)
|
||||
(main :class "flex-1"
|
||||
(header)
|
||||
(main
|
||||
children)
|
||||
; footer
|
||||
(footer))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue