aboutsummaryrefslogtreecommitdiff
path: root/captain/external.f90
diff options
context:
space:
mode:
Diffstat (limited to 'captain/external.f90')
-rw-r--r--captain/external.f9025
1 files changed, 17 insertions, 8 deletions
diff --git a/captain/external.f90 b/captain/external.f90
index d33e13d..86efe94 100644
--- a/captain/external.f90
+++ b/captain/external.f90
@@ -4,12 +4,12 @@ implicit none
contains
- subroutine external_request_gemini(request)
+ function external_request_gemini(request) result(renderunit)
use page_template
implicit none
character(*), intent(in)::request
-
+ integer::renderunit
character(1024)::template_file
type(template)::page
@@ -19,25 +19,34 @@ contains
if(trim(request) == "/" .or. trim(request) == "/index.gmi") then
-
-
+ call page%assign('title', 'Home')
+
else if(trim(request) == "/releases.gmi") then
-
+ call page%assign('title', 'Releases')
else if(trim(request) == "/jobs.gmi") then
-
+ call page%assign('title', 'Jobs')
else if(trim(request) == "/players.gmi") then
-
+ call page%assign('title', 'Players')
else if(trim(request) == "/about.gmi") then
+ call page%assign('title', 'About')
+
+ else
+
+ call page%assign('title', 'Not Found')
end if
+
+ open(newunit=renderunit, form="formatted", status="scratch", access='stream')
+
+ call page%render(renderunit)
- end subroutine external_request_gemini
+ end function external_request_gemini
end module external_handling \ No newline at end of file