main #3

Merged
array-in-a-matrix merged 17 commits from main into hpx-spa 2024-01-10 19:49:12 -05:00
2 changed files with 12 additions and 4 deletions
Showing only changes of commit cc0b5fa254 - Show all commits

10
src/components/read.nim Normal file
View file

@ -0,0 +1,10 @@
import happyx, os
component Read:
title: string
if !fileExists("/public/Blog/{self.title}.html"):
route "/404"
`template`:
tIframe(src="/public/Blog/{self.title}.html", class="flex items-center flex-1 m-14 max-md:m-7 max-sm:m-0 rounded-3xl max-sm:rounded-none")

View file

@ -1,7 +1,7 @@
import import
happyx, happyx,
path_params, path_params,
components/[nav, glass] components/[nav, glass, read]
appRoutes("app"): appRoutes("app"):
"/": "/":
@ -14,9 +14,7 @@ appRoutes("app"):
"/<article>": "/<article>":
component Nav component Nav
component Glass($article) component Read($article)
# TODO: pass article title to component which renders the article; modify Glass or a new component is needed
# TODO: check if article name exists otherwise route to /404
notfound: notfound:
route "/404" route "/404"