Switch to single page application #2

Merged
array-in-a-matrix merged 8 commits from hpx-spa into main 2024-01-08 21:04:02 -05:00
3 changed files with 9 additions and 5 deletions
Showing only changes of commit dc22440b42 - Show all commits

View file

@ -3296,5 +3296,4 @@ $$
<p>Please see the <a data-from-md="" title="https://joplinapp.org/donate/" href="https://joplinapp.org/donate/">donation page</a> for information on how to support the development of Joplin.</p>
</div></div>
</body>
</html>
</html>

View file

@ -8,6 +8,10 @@ templateFolder("templates")
proc renderPage(title: string): string =
renderTemplate("index.nimja")
type httpErrors = object
code: string
# description: string
# ? Serve at http://127.0.0.1:5000
serve("127.0.0.1", 5000):
@ -21,7 +25,8 @@ serve("127.0.0.1", 5000):
echo req
notfound:
return renderPage("404")
let error = httpErrors(code: "404")
return renderPage(error.code)
# make base articles and assets publicly accessible
staticDir "src/articles"

View file

@ -69,9 +69,9 @@
{% if title == "" %}
{% elif title == "404" %}
does not exist
Page does not exist.
{% else %}
<iframe class="w-full min-h-screen" src="/src/articles/{{title}}.html" seamless></iframe>
<iframe class="w-full h-screen" src="/src/articles/{{title}}.html" seamless></iframe>
{% endif %}
</section>