add static site generator
This commit is contained in:
12
www/src/templates/comments.hy
Normal file
12
www/src/templates/comments.hy
Normal file
@ -0,0 +1,12 @@
|
||||
(import urllib.parse [quote-plus])
|
||||
|
||||
(defn comments [route]
|
||||
`(section (:class comments)
|
||||
(h2 comments)
|
||||
(form (:id comment :method post :action ~f"/comment?route={route}" :autocomplete off)
|
||||
(textarea (:id comment :name comment :placeholder comment :required True :maxlength 2048))
|
||||
(input (:id name :type text :name name :placeholder username :required True :maxlength 32))
|
||||
(input (:id website :type text :name site :placeholder "website (not required)" :maxlength 256))
|
||||
(input (:id submit :type submit :value post)))
|
||||
|
||||
(~f"$[ls -r ./www/data/comments/{(quote-plus route :safe "")} | xargs -I# cat ./www/data/comments/{(quote-plus route :safe "")}/#]")))
|
Reference in New Issue
Block a user