aboutsummaryrefslogtreecommitdiff
path: root/captain/external.f90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-03-29 16:38:00 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-03-29 16:38:00 -0400
commitbe976a38f1d95258f19d94f4cf5dc4c677041ed9 (patch)
treedf8557c3d44c6dc41a29f34646d5d231d6075270 /captain/external.f90
parent7614a6244d080b8c0f82da8c34ccf7a4a88fe72a (diff)
downloadlevitating-be976a38f1d95258f19d94f4cf5dc4c677041ed9.tar.gz
levitating-be976a38f1d95258f19d94f4cf5dc4c677041ed9.zip
Changed how temp files work on UNIX-y stuff. Fixed templates, which were quite broken.
Diffstat (limited to 'captain/external.f90')
-rw-r--r--captain/external.f9017
1 files changed, 11 insertions, 6 deletions
diff --git a/captain/external.f90 b/captain/external.f90
index 86efe94..aa65e71 100644
--- a/captain/external.f90
+++ b/captain/external.f90
@@ -4,18 +4,23 @@ implicit none
contains
- function external_request_gemini(request) result(renderunit)
+ function external_request_gemini(request) result(disk_filename)
use page_template
+ use config, only: template_filepath
+ use logging, only: write_log
implicit none
character(*), intent(in)::request
+ character(len=:), pointer::disk_filename
integer::renderunit
character(1024)::template_file
type(template)::page
+ character(16)::log_tmp
! Open the base template
call template_filepath("index.gmi", template_file)
- call page%init(template_file)
+
+ call page%init(trim(template_file))
if(trim(request) == "/" .or. trim(request) == "/index.gmi") then
@@ -42,11 +47,11 @@ contains
call page%assign('title', 'Not Found')
end if
-
- open(newunit=renderunit, form="formatted", status="scratch", access='stream')
-
- call page%render(renderunit)
+
+ call page%render()
+ disk_filename => page%output_filename
+
end function external_request_gemini
end module external_handling \ No newline at end of file