Switch to single page application #2
3 changed files with 9 additions and 5 deletions
|
@ -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>
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Reference in a new issue