From 031473807e1f1d811d1e294e09cbca6c6ba839f9 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Mon, 25 Oct 2021 23:33:28 +0200 Subject: Added about page and a nav menu that links to it --- src/short.nim | 5 +++++ src/templates/about.html | 10 ++++++++++ src/templates/index.html | 10 +++------- src/templates/partials/master.html | 1 + src/templates/partials/nav.html | 10 ++++++++++ 5 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 src/templates/about.html create mode 100644 src/templates/partials/nav.html (limited to 'src') diff --git a/src/short.nim b/src/short.nim index df26552..fa5486a 100644 --- a/src/short.nim +++ b/src/short.nim @@ -24,6 +24,9 @@ func renderIndex(): string {.raises: [].} = var req: ShortUrl compileTemplateFile(getScriptDir() / "templates/index.html") +func renderAbout(): string {.raises: [].} = + compileTemplateFile(getScriptDir() / "templates/about.html") + func renderShort(req: ShortUrl): string {.raises: [].} = compileTemplateFile(getScriptDir() / "templates/short.html") @@ -96,6 +99,8 @@ proc handleIndexPost(params: Table[string, string]): (HttpCode, string) {.raises routes: get "/": resp renderIndex() + get "/about": + resp renderAbout() post "/": initDB() var (code, content) = handleIndexPost(request.params) diff --git a/src/templates/about.html b/src/templates/about.html new file mode 100644 index 0000000..772ee35 --- /dev/null +++ b/src/templates/about.html @@ -0,0 +1,10 @@ +{% extends "templates/partials/master.html" %} +{% block content %} +

URL shortener

+

+The simple, self-hosted, open source and privacy friendly URL shortener : anonymous usage, no tracking.
+This is a personal sharing service: Data may be deleted anytime. Don't share illegal, unethical or morally reprehensible content. +

+

+This service is written in nim, its source code can be found here and is mirrored to github here. +{% endblock %} diff --git a/src/templates/index.html b/src/templates/index.html index b89e381..acce5c4 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -1,13 +1,9 @@ {% extends "templates/partials/master.html" %} {% block content %} -

URL shortener

-

-The simple, open source and privacy friendly URL shortener : anonymous usage, no tracking.
-This is a personal sharing service: Data may be deleted anytime. Don't share illegal, unethical or morally reprehensible content. -

+

Shorten a URL

-
-
+
+